MCPcopy
hub / github.com/RoaringBitmap/roaring / equals

Method equals

bitmapcontainer.go:342–364  ·  view source on GitHub ↗
(o container)

Source from the content-addressed store, hash-verified

340}
341
342func (bc *bitmapContainer) equals(o container) bool {
343 srb, ok := o.(*bitmapContainer)
344 if ok {
345 if srb.cardinality != bc.cardinality {
346 return false
347 }
348 return bitmapEquals(bc.bitmap, srb.bitmap)
349 }
350
351 // use generic comparison
352 if bc.getCardinality() != o.getCardinality() {
353 return false
354 }
355 ait := o.getShortIterator()
356 bit := bc.getShortIterator()
357
358 for ait.hasNext() {
359 if bit.next() != ait.next() {
360 return false
361 }
362 }
363 return true
364}
365
366func (bc *bitmapContainer) iaddReturnMinimized(i uint16) container {
367 bc.iadd(i)

Callers

nothing calls this directly

Calls 7

getCardinalityMethod · 0.95
getShortIteratorMethod · 0.95
bitmapEqualsFunction · 0.85
getCardinalityMethod · 0.65
getShortIteratorMethod · 0.65
hasNextMethod · 0.65
nextMethod · 0.65

Tested by

no test coverage detected