File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -709,7 +709,7 @@ func (i *similarityIndex) common(dst *similarityIndex) uint64 {
709
709
}
710
710
711
711
func (i * similarityIndex ) add (key int , cnt uint64 ) error {
712
- key = int (uint32 (key ) * 0x9e370001 >> 1 )
712
+ key = int (uint32 (key )* 0x9e370001 >> 1 )
713
713
714
714
j := i .slot (key )
715
715
for {
@@ -769,11 +769,11 @@ func (i *similarityIndex) slot(key int) int {
769
769
// We use 31 - hashBits because the upper bit was already forced
770
770
// to be 0 and we want the remaining high bits to be used as the
771
771
// table slot.
772
- return int (uint32 (key ) >> (31 - i .hashBits ))
772
+ return int (uint32 (key ) >> uint (31 - i .hashBits ))
773
773
}
774
774
775
775
func shouldGrowAt (hashBits int ) int {
776
- return (1 << hashBits ) * (hashBits - 3 ) / hashBits
776
+ return (1 << uint ( hashBits ) ) * (hashBits - 3 ) / hashBits
777
777
}
778
778
779
779
func (i * similarityIndex ) grow () error {
@@ -788,7 +788,7 @@ func (i *similarityIndex) grow() error {
788
788
789
789
// TODO(erizocosmico): find a way to check if it will OOM and return
790
790
// errIndexFull instead.
791
- i .hashes = make ([]keyCountPair , 1 << i .hashBits )
791
+ i .hashes = make ([]keyCountPair , 1 << uint ( i .hashBits ) )
792
792
793
793
for _ , v := range old {
794
794
if v != 0 {
You can’t perform that action at this time.
0 commit comments