Skip to content

Commit 1df4a39

Browse files
jas4711matthewmcneely
authored andcommitted
Fix compilation on 32-bit archs (#465)
src/github.com/dgraph-io/ristretto/sketch_test.go:67:8: cannot use 12 << 30 (untyped int constant 12884901888) as int value in assignment (overflows) src/github.com/dgraph-io/ristretto/store_test.go:209:23: cannot use 4340958203495 (untyped int constant) as int value in argument to z.KeyToHash (overflows)
1 parent 2c4d526 commit 1df4a39

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sketch_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func TestSketchClear(t *testing.T) {
6464
}
6565

6666
func TestNext2Power(t *testing.T) {
67-
sz := 12 << 30
67+
sz := int64(12) << 30
6868
szf := float64(sz) * 0.01
6969
val := int64(szf)
7070
t.Logf("szf = %.2f val = %d\n", szf, val)

store_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ func TestStoreExpiration(t *testing.T) {
206206
require.True(t, s.Expiration(key).IsZero())
207207

208208
// missing item
209-
key, _ = z.KeyToHash(4340958203495)
209+
key, _ = z.KeyToHash(int64(4340958203495))
210210
ttl = s.Expiration(key)
211211
require.True(t, ttl.IsZero())
212212
}

0 commit comments

Comments
 (0)