File tree Expand file tree Collapse file tree 1 file changed +13
-13
lines changed
Expand file tree Collapse file tree 1 file changed +13
-13
lines changed Original file line number Diff line number Diff line change 1919VAL = TypeVar ("VAL" )
2020
2121
22- def _next_power_of_two (n : int ) -> int :
23- if n < 1 :
24- raise ValueError ("n must be >= 1" )
25- return 1 << (n - 1 ).bit_length ()
22+ def _next_power_of_two (number : int ) -> int :
23+ if number < 1 :
24+ raise ValueError ("number must be >= 1" )
25+ return 1 << (number - 1 ).bit_length ()
2626
2727
28- def _mix_hash (h : int ) -> int :
28+ def _mix_hash (hash_value : int ) -> int :
2929 # Simple avalanching to make low bits more useful.
30- h ^= h >> 16
31- h *= 0x85EBCA6B
32- h &= 0xFFFFFFFFFFFFFFFF
33- h ^= h >> 13
34- h *= 0xC2B2AE35
35- h &= 0xFFFFFFFFFFFFFFFF
36- h ^= h >> 16
37- return h
30+ hash_value ^= hash_value >> 16
31+ hash_value *= 0x85EBCA6B
32+ hash_value &= 0xFFFFFFFFFFFFFFFF
33+ hash_value ^= hash_value >> 13
34+ hash_value *= 0xC2B2AE35
35+ hash_value &= 0xFFFFFFFFFFFFFFFF
36+ hash_value ^= hash_value >> 16
37+ return hash_value
3838
3939
4040@dataclass (slots = True )
You can’t perform that action at this time.
0 commit comments