Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
Cast idx to uint32 to fix compilation on i386 (#1118)
Browse files Browse the repository at this point in the history
`env GOOS=linux GOARCH=386` go build no longer complains about integer overflow.

See dgraph-io/badger#953 (comment)
  • Loading branch information
Ibrahim Jarif authored Nov 20, 2019
1 parent 909ba37 commit 46ec411
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion badger/table/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 46ec411

Please sign in to comment.