forked from RoaringBitmap/roaring
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds bitmap.NextMany() functionality - a higher performance bulk next…
… method. +tests +benchmarks
- Loading branch information
Ben Shaw
committed
Feb 22, 2018
1 parent
7580aaa
commit 92a1592
Showing
12 changed files
with
486 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package roaring | ||
|
||
type manyIterable interface { | ||
nextMany(hs uint32, buf []uint32) int | ||
} | ||
|
||
type manyIterator struct { | ||
slice []uint16 | ||
loc int | ||
} | ||
|
||
func (si *manyIterator) nextMany(hs uint32, buf []uint32) int { | ||
n := 0 | ||
l := si.loc | ||
s := si.slice | ||
for n < len(buf) && l < len(s) { | ||
buf[n] = uint32(s[l]) | hs | ||
l++ | ||
n++ | ||
} | ||
si.loc = l | ||
return n | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.