Skip to content

Commit fbecbe5

Browse files
committed
Mark functions available in Go 1.9 as deprecated.
1 parent ba28a67 commit fbecbe5

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

funcs.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ const (
1414

1515
// LeadingZeros returns the number of leading zero bits in w;
1616
// it returns 64 when w is zero.
17+
//
18+
// Deprecated: In Go 1.9 this function is available in package math/bits as LeadingZeros64.
1719
func LeadingZeros(w uint64) int {
1820
// Fill word with ones on the right, e.g. 0x0000f308 -> 0x0000ffff.
1921
w |= w >> 1
@@ -27,6 +29,8 @@ func LeadingZeros(w uint64) int {
2729

2830
// TrailingZeros returns the number of trailing zero bits in w;
2931
// it returns 64 when w is zero.
32+
//
33+
// Deprecated: In Go 1.9 this function is available in package math/bits as TrailingZeros64.
3034
func TrailingZeros(w uint64) int {
3135
// “Using de Bruijn Sequences to Index a 1 in a Computer Word”,
3236
// Leiserson, Prokop, and Randall, MIT, 1998.
@@ -53,6 +57,8 @@ func init() {
5357
}
5458

5559
// Count returns the number of nonzero bits in w.
60+
//
61+
// Deprecated: In Go 1.9 this function is available in package math/bits as OnesCount64.
5662
func Count(w uint64) int {
5763
// “Software Optimization Guide for AMD64 Processors”, Section 8.6.
5864
const maxw = 1<<64 - 1

0 commit comments

Comments
 (0)