MCPcopy Index your code
hub / github.com/Workiva/go-datastructures / Intersects

Method Intersects

bitarray/bitarray.go:296–306  ·  view source on GitHub ↗

Intersects returns a bool indicating if the supplied bitarray intersects this bitarray. This will check for intersection up to the length of the supplied bitarray. If the supplied bitarray is longer than this bitarray, this function returns false.

(other BitArray)

Source from the content-addressed store, hash-verified

294// bitarray. If the supplied bitarray is longer than this bitarray, this
295// function returns false.
296func (ba *bitArray) Intersects(other BitArray) bool {
297 if other.Capacity() > ba.Capacity() {
298 return false
299 }
300
301 if sba, ok := other.(*sparseBitArray); ok {
302 return ba.intersectsSparseBitArray(sba)
303 }
304
305 return ba.intersectsDenseBitArray(other.(*bitArray))
306}
307
308// Blocks will return an iterator over this bit array.
309func (ba *bitArray) Blocks() Iterator {

Callers

nothing calls this directly

Calls 4

CapacityMethod · 0.95
CapacityMethod · 0.65

Tested by

no test coverage detected