In the go source code, the constant bucketCnt
is 8. Why is defined in terms of right-shifting 3 times instead of just defining it as 8.
I understand that 1 << x
implies 2^x
.
But, my question is...
Is
// Maximum number of key/value pairs a bucket can hold.
bucketCntBits = 3
bucketCnt = 1 << bucketCntBits
better than
// Maximum number of key/value pairs a bucket can hold.
bucketCnt = 8