Skip to content

Commit

Permalink
Applying golint
Browse files Browse the repository at this point in the history
  • Loading branch information
lemire committed Oct 21, 2017
1 parent bb28259 commit 9fee29c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions bitmapcontainer.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func newBitmapContainerwithRange(firstOfRun, lastOfRun int) *bitmapContainer {
}

func (bc *bitmapContainer) minimum() uint16 {
for i := 0; i < len(bc.bitmap); i += 1 {
for i := 0; i < len(bc.bitmap); i++ {
w := bc.bitmap[i]
if w != 0 {
r := countTrailingZeros(w)
Expand Down Expand Up @@ -86,7 +86,7 @@ func clz(i uint64) int {
}

func (bc *bitmapContainer) maximum() uint16 {
for i := len(bc.bitmap); i > 0; i -= 1 {
for i := len(bc.bitmap); i > 0; i-- {
w := bc.bitmap[i-1]
if w != 0 {
r := clz(w)
Expand Down
8 changes: 7 additions & 1 deletion parallel.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func appenderRoutine(bitmapChan chan<- *Bitmap, resultChan <-chan keyedContainer
keys[item.idx] = item.key
containers[item.idx] = item.container

appendedKeys += 1
appendedKeys++
case msg := <-expectedKeysChan:
expectedKeys = msg
}
Expand All @@ -176,6 +176,9 @@ func appenderRoutine(bitmapChan chan<- *Bitmap, resultChan <-chan keyedContainer
bitmapChan <- answer
}

// ParOr computes the union (OR) of all provided bitmaps in parallel,
// where the parameter "parallelism" determines how many workers are to be used
// (if it is set to 0, a default number of workers is chosen)
func ParOr(parallelism int, bitmaps ...*Bitmap) *Bitmap {
bitmapCount := len(bitmaps)
if bitmapCount == 0 {
Expand Down Expand Up @@ -244,6 +247,9 @@ func ParOr(parallelism int, bitmaps ...*Bitmap) *Bitmap {
return bitmap
}

// ParAnd computes the intersection (AND) of all provided bitmaps in parallel,
// where the parameter "parallelism" determines how many workers are to be used
// (if it is set to 0, a default number of workers is chosen)
func ParAnd(parallelism int, bitmaps ...*Bitmap) *Bitmap {
bitmapCount := len(bitmaps)
if bitmapCount == 0 {
Expand Down
6 changes: 3 additions & 3 deletions rlei.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ func (rc *runContainer16) andArrayCardinality(ac *arrayContainer) int {
mainloop:
for _, p := range rc.iv {
for v < p.start {
pos += 1
pos++
if pos == maxpos {
break mainloop
}
v = ac.content[pos]
}
for v <= p.last {
answer += 1
pos += 1
answer++
pos++
if pos == maxpos {
break mainloop
}
Expand Down
2 changes: 1 addition & 1 deletion roaring_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestFirstLast(t *testing.T) {
t.FailNow()
}
i := 1 << 5
for ; i < (1 << 17); i += 1 {
for ; i < (1 << 17); i++ {
bm.AddInt(i)
if 2 != bm.Minimum() {
t.Errorf("bad minimum")
Expand Down

0 comments on commit 9fee29c

Please sign in to comment.