Commit 0dd24ab
committed
bitmap: use bits.LeadingZeros64 intrinsic in maximum()
bitmapContainer.maximum() relied on a hand-rolled clz() to find the
highest set bit in the most significant non-empty word. That helper
reimplemented, in portable shift/compare arithmetic, what the standard
library already exposes as math/bits.LeadingZeros64, which the Go
compiler lowers to a single hardware instruction (LZCNT on amd64, CLZ on
arm64). The package already wraps it as countLeadingZeros (clz.go), so
maximum() now calls that and the redundant clz() helper is deleted.1 parent 9e2afa4 commit 0dd24ab
1 file changed
Lines changed: 1 addition & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | 72 | | |
100 | 73 | | |
101 | 74 | | |
102 | 75 | | |
103 | | - | |
104 | | - | |
| 76 | + | |
105 | 77 | | |
106 | 78 | | |
107 | 79 | | |
| |||
0 commit comments