diff --git a/ewah/bitcounter.go b/ewah/bitcounter.go index 5c73903..53ee0cf 100644 --- a/ewah/bitcounter.go +++ b/ewah/bitcounter.go @@ -24,13 +24,13 @@ func newBitCounter() BitmapStorage { var _ BitmapStorage = (*bitCounter)(nil) -func (this *bitCounter) add(newdata uint64) { +func (this *bitCounter) addWord(newdata uint64) { this.oneBits += popcount_3(newdata) } func (this *bitCounter) addStreamOfLiteralWords(data []uint64, start, number int32) { for i := start; i < start + number; i++ { - this.add(data[i]) + this.addWord(data[i]) } } @@ -42,7 +42,7 @@ func (this *bitCounter) addStreamOfEmptyWords(v bool, number int64) { func (this *bitCounter) addStreamOfNegatedLiteralWords(data []uint64, start, number int32) { for i := start; i < start + number; i++ { - this.add(^data[i]) + this.addWord(^data[i]) } } diff --git a/ewah/bitmap_storage.go b/ewah/bitmap_storage.go index 8717f99..c4e4a79 100644 --- a/ewah/bitmap_storage.go +++ b/ewah/bitmap_storage.go @@ -7,7 +7,7 @@ package ewah type BitmapStorage interface { - add(uint64) + addWord(uint64) addStreamOfLiteralWords([]uint64, int32, int32) addStreamOfEmptyWords(bool, int64) addStreamOfNegatedLiteralWords([]uint64, int32, int32) diff --git a/ewah/bitops.go b/ewah/bitops.go index 53b0ecc..5ff563a 100644 --- a/ewah/bitops.go +++ b/ewah/bitops.go @@ -225,7 +225,7 @@ func (this *Ewah) andToContainer(a *Ewah, container BitmapStorage) { if leftOverLiterals > 0 { // for each of the left over literals, we will AND them and put the result in the contanier for k := int64(0); k < leftOverLiterals; k++ { - container.add(iCursor.getLiteralWordAt(k) & jCursor.getLiteralWordAt(k)) + container.addWord(iCursor.getLiteralWordAt(k) & jCursor.getLiteralWordAt(k)) } // Move the cursors forward @@ -324,7 +324,7 @@ func (this *Ewah) andNotToContainer(a *Ewah, container BitmapStorage) { if leftOverLiterals > 0 { for k := int64(0); k < leftOverLiterals; k++ { - container.add(iCursor.getLiteralWordAt(k) &^ jCursor.getLiteralWordAt(k)) + container.addWord(iCursor.getLiteralWordAt(k) &^ jCursor.getLiteralWordAt(k)) } iCursor.moveForward(leftOverLiterals) @@ -405,7 +405,7 @@ func (this *Ewah) orToContainer(a *Ewah, container BitmapStorage) { if leftOverLiterals > 0 { for k := int64(0); k < leftOverLiterals; k++ { - container.add(iCursor.getLiteralWordAt(k) | jCursor.getLiteralWordAt(k)) + container.addWord(iCursor.getLiteralWordAt(k) | jCursor.getLiteralWordAt(k)) } // Move the cursors forward @@ -474,7 +474,7 @@ func (this *Ewah) xorToContainer(a *Ewah, container BitmapStorage) { if leftOverLiterals > 0 { for k := int64(0); k < leftOverLiterals; k++ { - container.add(iCursor.getLiteralWordAt(k) ^ jCursor.getLiteralWordAt(k)) + container.addWord(iCursor.getLiteralWordAt(k) ^ jCursor.getLiteralWordAt(k)) } // Move the cursors forward diff --git a/ewah/ewah.go b/ewah/ewah.go index 489dbd3..d4cb53b 100644 --- a/ewah/ewah.go +++ b/ewah/ewah.go @@ -325,8 +325,8 @@ func (this *Ewah) printDetails() { // -// add is used to add words directly to the bitmap. -func (this *Ewah) add(newdata uint64) { +// addWord is used to add words directly to the bitmap. +func (this *Ewah) addWord(newdata uint64) { this.addSignificantBits(newdata, wordInBits) }