1
0
mirror of https://github.com/golang/go synced 2024-11-11 20:20:23 -07:00

bits: use same expression with system bit size

Change-Id: Ibce07f8f36f7c64f7022ce656f8efbec5dff3f82
Reviewed-on: https://go-review.googlesource.com/c/go/+/313829
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
This commit is contained in:
yangwenmai 2021-04-27 08:30:25 +08:00 committed by Keith Randall
parent bc6288794d
commit d553c0144d
2 changed files with 2 additions and 2 deletions

View File

@ -12,7 +12,7 @@ import (
// If true, check poset integrity after every mutation
var debugPoset = false
const uintSize = 32 << (^uint(0) >> 32 & 1) // 32 or 64
const uintSize = 32 << (^uint(0) >> 63) // 32 or 64
// bitset is a bit array for dense indexes.
type bitset []uint

View File

@ -8,7 +8,7 @@
// functions for the predeclared unsigned integer types.
package bits
const uintSize = 32 << (^uint(0) >> 32 & 1) // 32 or 64
const uintSize = 32 << (^uint(0) >> 63) // 32 or 64
// UintSize is the size of a uint in bits.
const UintSize = uintSize