mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
Revert "x/tools/container/intsets: remove unused function"
This reverts commit 79902b439b3ef4c163ff5e96ac1f282f31c8a131. Reason for revert: build broken on some platforms. Change-Id: I5ceddc305580ff97f47ae27da831f99e96dab424 Reviewed-on: https://go-review.googlesource.com/37539 Reviewed-by: David R. Jenni <david.r.jenni@gmail.com> Reviewed-by: Alan Donovan <adonovan@google.com>
This commit is contained in:
parent
f9348ea9b1
commit
81cc31eaa9
@ -4,6 +4,16 @@
|
||||
|
||||
package intsets
|
||||
|
||||
// From Hacker's Delight, fig 5.2.
|
||||
func popcountHD(x uint32) int {
|
||||
x -= (x >> 1) & 0x55555555
|
||||
x = (x & 0x33333333) + ((x >> 2) & 0x33333333)
|
||||
x = (x + (x >> 4)) & 0x0f0f0f0f
|
||||
x = x + (x >> 8)
|
||||
x = x + (x >> 16)
|
||||
return int(x & 0x0000003f)
|
||||
}
|
||||
|
||||
var a [1 << 8]byte
|
||||
|
||||
func init() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user