Skip to content

Commit 74d44b5

Browse files
committed
Switch to simplified mask(n) function
1 parent 8c8c0c8 commit 74d44b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bit32.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
const bitCount = 32
88

99
func trim(x uint) uint { return x & math.MaxUint32 }
10-
func mask(n uint) uint { return ^((math.MaxUint32 << (n - 1)) << 1) }
10+
func mask(n uint) uint { return ^(math.MaxUint32 << n) }
1111

1212
func shift(l *State, r uint, i int) int {
1313
if i < 0 {

0 commit comments

Comments
 (0)