Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming add to addWord to avoid confusion #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ewah/bitcounter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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])
}
}

Expand All @@ -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])
}
}

Expand Down
2 changes: 1 addition & 1 deletion ewah/bitmap_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
package ewah

type BitmapStorage interface {
add(uint64)
addWord(uint64)
addStreamOfLiteralWords([]uint64, int32, int32)
addStreamOfEmptyWords(bool, int64)
addStreamOfNegatedLiteralWords([]uint64, int32, int32)
Expand Down
8 changes: 4 additions & 4 deletions ewah/bitops.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions ewah/ewah.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down