Skip to content

Commit 9fee29c

Browse files
committed
Applying golint
1 parent bb28259 commit 9fee29c

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

bitmapcontainer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func newBitmapContainerwithRange(firstOfRun, lastOfRun int) *bitmapContainer {
4848
}
4949

5050
func (bc *bitmapContainer) minimum() uint16 {
51-
for i := 0; i < len(bc.bitmap); i += 1 {
51+
for i := 0; i < len(bc.bitmap); i++ {
5252
w := bc.bitmap[i]
5353
if w != 0 {
5454
r := countTrailingZeros(w)
@@ -86,7 +86,7 @@ func clz(i uint64) int {
8686
}
8787

8888
func (bc *bitmapContainer) maximum() uint16 {
89-
for i := len(bc.bitmap); i > 0; i -= 1 {
89+
for i := len(bc.bitmap); i > 0; i-- {
9090
w := bc.bitmap[i-1]
9191
if w != 0 {
9292
r := clz(w)

parallel.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ func appenderRoutine(bitmapChan chan<- *Bitmap, resultChan <-chan keyedContainer
155155
keys[item.idx] = item.key
156156
containers[item.idx] = item.container
157157

158-
appendedKeys += 1
158+
appendedKeys++
159159
case msg := <-expectedKeysChan:
160160
expectedKeys = msg
161161
}
@@ -176,6 +176,9 @@ func appenderRoutine(bitmapChan chan<- *Bitmap, resultChan <-chan keyedContainer
176176
bitmapChan <- answer
177177
}
178178

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

250+
// ParAnd computes the intersection (AND) of all provided bitmaps in parallel,
251+
// where the parameter "parallelism" determines how many workers are to be used
252+
// (if it is set to 0, a default number of workers is chosen)
247253
func ParAnd(parallelism int, bitmaps ...*Bitmap) *Bitmap {
248254
bitmapCount := len(bitmaps)
249255
if bitmapCount == 0 {

rlei.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@ func (rc *runContainer16) andArrayCardinality(ac *arrayContainer) int {
7979
mainloop:
8080
for _, p := range rc.iv {
8181
for v < p.start {
82-
pos += 1
82+
pos++
8383
if pos == maxpos {
8484
break mainloop
8585
}
8686
v = ac.content[pos]
8787
}
8888
for v <= p.last {
89-
answer += 1
90-
pos += 1
89+
answer++
90+
pos++
9191
if pos == maxpos {
9292
break mainloop
9393
}

roaring_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func TestFirstLast(t *testing.T) {
2323
t.FailNow()
2424
}
2525
i := 1 << 5
26-
for ; i < (1 << 17); i += 1 {
26+
for ; i < (1 << 17); i++ {
2727
bm.AddInt(i)
2828
if 2 != bm.Minimum() {
2929
t.Errorf("bad minimum")

0 commit comments

Comments
 (0)