This makes it clearer that i and hbits advance together.
As a bonus, it generates slightly better code.
Change-Id: I24d51102535c39f962a59c1a4a7c5c894339aa18
Reviewed-on: https://go-review.googlesource.com/c/go/+/309569
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
}
var i uintptr
- for i = 0; i < n; i += sys.PtrSize {
- // Find bits for this word.
- if i != 0 {
- // Avoid needless hbits.next() on last iteration.
- hbits = hbits.next()
- }
+ for i = 0; i < n; i, hbits = i+sys.PtrSize, hbits.next() {
// Load bits once. See CL 22712 and issue 16973 for discussion.
bits := hbits.bits()
if bits&bitScan == 0 {