MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / And

Method And

libs/bits/bit_array.go:139–150  ·  view source on GitHub ↗

And returns a bit array resulting from a bitwise AND of the two bit arrays. If the two bit-arrys have different lengths, this truncates the larger of the two bit-arrays from the right. Thus the size of the return value is the minimum of the two provided bit arrays.

(o *BitArray)

Source from the content-addressed store, hash-verified

137// If the two bit-arrys have different lengths, this truncates the larger of the two bit-arrays from the right.
138// Thus the size of the return value is the minimum of the two provided bit arrays.
139func (bA *BitArray) And(o *BitArray) *BitArray {
140 if bA == nil || o == nil {
141 return nil
142 }
143 bA.mtx.Lock()
144 o.mtx.Lock()
145 defer func() {
146 bA.mtx.Unlock()
147 o.mtx.Unlock()
148 }()
149 return bA.and(o)
150}
151
152func (bA *BitArray) and(o *BitArray) *BitArray {
153 c := bA.copyBits(tmmath.MinInt(bA.Bits, o.Bits))

Callers 1

TestAndFunction · 0.95

Calls 3

andMethod · 0.95
LockMethod · 0.65
UnlockMethod · 0.65

Tested by 1

TestAndFunction · 0.76