summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/RoaringBitmap/roaring/util.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/RoaringBitmap/roaring/util.go')
-rw-r--r--vendor/github.com/RoaringBitmap/roaring/util.go33
1 files changed, 11 insertions, 22 deletions
diff --git a/vendor/github.com/RoaringBitmap/roaring/util.go b/vendor/github.com/RoaringBitmap/roaring/util.go
index d212660d58..3a9a47236b 100644
--- a/vendor/github.com/RoaringBitmap/roaring/util.go
+++ b/vendor/github.com/RoaringBitmap/roaring/util.go
@@ -14,6 +14,17 @@ const (
serialCookie = 12347 // runs, arrays, and bitmaps
noOffsetThreshold = 4
+ // MaxUint32 is the largest uint32 value.
+ MaxUint32 = 4294967295
+
+ // MaxRange is One more than the maximum allowed bitmap bit index. For use as an upper
+ // bound for ranges.
+ MaxRange uint64 = MaxUint32 + 1
+
+ // MaxUint16 is the largest 16 bit unsigned int.
+ // This is the largest value an interval16 can store.
+ MaxUint16 = 65535
+
// Compute wordSizeInBytes, the size of a word in bytes.
_m = ^uint64(0)
_logS = _m>>8&1 + _m>>16&1 + _m>>32&1
@@ -114,7 +125,6 @@ func flipBitmapRange(bitmap []uint64, start int, end int) {
endword := (end - 1) / 64
bitmap[firstword] ^= ^(^uint64(0) << uint(start%64))
for i := firstword; i < endword; i++ {
- //p("flipBitmapRange on i=%v", i)
bitmap[i] = ^bitmap[i]
}
bitmap[endword] ^= ^uint64(0) >> (uint(-end) % 64)
@@ -292,24 +302,3 @@ func minOfUint16(a, b uint16) uint16 {
}
return b
}
-
-func maxInt(a, b int) int {
- if a > b {
- return a
- }
- return b
-}
-
-func maxUint16(a, b uint16) uint16 {
- if a > b {
- return a
- }
- return b
-}
-
-func minUint16(a, b uint16) uint16 {
- if a < b {
- return a
- }
- return b
-}