File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed
src/cmd/compile/internal/ssa Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -505,16 +505,10 @@ func isUnsignedPowerOfTwo[T uint8 | uint16 | uint32 | uint64](n T) bool {
505
505
}
506
506
507
507
// isUint64PowerOfTwo reports whether uint64(n) is a power of 2.
508
- func isUint64PowerOfTwo (in int64 ) bool {
509
- n := uint64 (in )
510
- return n != 0 && n & (n - 1 ) == 0
511
- }
508
+ func isUint64PowerOfTwo (in int64 ) bool { return isUnsignedPowerOfTwo (uint64 (in )) }
512
509
513
510
// isUint32PowerOfTwo reports whether uint32(n) is a power of 2.
514
- func isUint32PowerOfTwo (in int64 ) bool {
515
- n := uint64 (uint32 (in ))
516
- return n != 0 && n & (n - 1 ) == 0
517
- }
511
+ func isUint32PowerOfTwo (in int64 ) bool { return isUnsignedPowerOfTwo (uint32 (in )) }
518
512
519
513
// is32Bit reports whether n can be represented as a signed 32 bit integer.
520
514
func is32Bit (n int64 ) bool {
You can’t perform that action at this time.
0 commit comments