From fb0cdb858c78004b9db8f08e91bb713780b20445 Mon Sep 17 00:00:00 2001 From: Ibrahim Jarif Date: Thu, 21 Nov 2019 00:08:03 +0530 Subject: [PATCH] Cast idx to uint32 to fix compilation on i386 (#1118) `env GOOS=linux GOARCH=386` go build no longer complains about integer overflow. See https://github.com/dgraph-io/badger/issues/953#issuecomment-552241033 --- table/table.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/table/table.go b/table/table.go index 73b48c041..0dfc9d2f0 100644 --- a/table/table.go +++ b/table/table.go @@ -432,7 +432,7 @@ func (t *Table) block(idx int) (*block, error) { func (t *Table) blockCacheKey(idx int) uint64 { y.AssertTrue(t.ID() < math.MaxUint32) - y.AssertTrue(idx < math.MaxUint32) + y.AssertTrue(uint32(idx) < math.MaxUint32) return (t.ID() << 32) | uint64(idx) }