Added bitmask/MaskBit.Copy()
This commit is contained in:
brent saner 2024-04-14 01:54:59 -04:00
parent b87934e8a9
commit ae49f42c0c
Signed by: bts
GPG Key ID: 8C004C2F93481F6B

View File

@ -2,8 +2,8 @@ package bitmask


import ( import (
"bytes" "bytes"
"errors"
"encoding/binary" "encoding/binary"
"errors"
"math/bits" "math/bits"
) )


@ -109,6 +109,15 @@ func (m *MaskBit) Bytes(trim bool) (b []byte) {
return return
} }


// Copy returns a pointer to a (new) copy of a MaskBit.
func (m *MaskBit) Copy() (newM *MaskBit) {

newM = new(MaskBit)
*newM = *m

return
}

// Value returns the current raw uint value of a MaskBit. // Value returns the current raw uint value of a MaskBit.
func (m *MaskBit) Value() (v uint) { func (m *MaskBit) Value() (v uint) {