mirror of
https://github.com/golang/go.git
synced 2026-04-19 10:20:26 +00:00
In several places the integer log2 is calculated using loops or similar mechanisms. math/bits.Len* provide a simpler and more efficient mechanisms for this. Annoyingly, every usage has slightly different ideas of what "log2" means and how non-positive inputs should be handled. I verified the replacements in each case by comparing the result for inputs from 0 to 1<<16. Change-Id: Ie962a74674802da363e0038d34c06979ccb41cf3 Reviewed-on: https://go-review.googlesource.com/c/go/+/721880 Reviewed-by: Mark Freeman <markfreeman@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> |
||
|---|---|---|
| .. | ||
| example_interface_test.go | ||
| example_keys_test.go | ||
| example_multi_test.go | ||
| example_search_test.go | ||
| example_test.go | ||
| example_wrapper_test.go | ||
| export_test.go | ||
| gen_sort_variants.go | ||
| search.go | ||
| search_test.go | ||
| slice.go | ||
| sort.go | ||
| sort_slices_benchmark_test.go | ||
| sort_test.go | ||
| zsortfunc.go | ||
| zsortinterface.go | ||