aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvashish1 <vashishtiv@gmail.com>2020-05-08 19:57:35 +0530
committervashish1 <vashishtiv@gmail.com>2020-05-08 19:57:35 +0530
commit5b59577e00a59f06e729847435586f617ab832a3 (patch)
treeb7aa20548c25eb8da4501655dd155033442dbbc0
parent79798d4a85b9389b28ef26b70944157d16fc205a (diff)
downloadgo-git-5b59577e00a59f06e729847435586f617ab832a3.tar.gz
performed explicit conversions(needed)
-rw-r--r--plumbing/object/rename.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/plumbing/object/rename.go b/plumbing/object/rename.go
index b0c62b2..35af1d6 100644
--- a/plumbing/object/rename.go
+++ b/plumbing/object/rename.go
@@ -709,7 +709,7 @@ func (i *similarityIndex) common(dst *similarityIndex) uint64 {
}
func (i *similarityIndex) add(key int, cnt uint64) error {
- key = int(uint32(key) * 0x9e370001 >> 1)
+ key = int(uint32(key)*0x9e370001 >> 1)
j := i.slot(key)
for {
@@ -769,11 +769,11 @@ func (i *similarityIndex) slot(key int) int {
// We use 31 - hashBits because the upper bit was already forced
// to be 0 and we want the remaining high bits to be used as the
// table slot.
- return int(uint32(key) >> (31 - i.hashBits))
+ return int(uint32(key) >> uint(31 - i.hashBits))
}
func shouldGrowAt(hashBits int) int {
- return (1 << hashBits) * (hashBits - 3) / hashBits
+ return (1 << uint(hashBits)) * (hashBits - 3) / hashBits
}
func (i *similarityIndex) grow() error {
@@ -788,7 +788,7 @@ func (i *similarityIndex) grow() error {
// TODO(erizocosmico): find a way to check if it will OOM and return
// errIndexFull instead.
- i.hashes = make([]keyCountPair, 1<<i.hashBits)
+ i.hashes = make([]keyCountPair, 1<<uint(i.hashBits))
for _, v := range old {
if v != 0 {