[bisect] Generalize halving logic in util.rs Many strategies may resort to a 1-dimensional bisection strategy at some phase of their execution. This CL centralizes that code by adding a new "halve_dimension" utility function that accepts the dimension to halve as a parameter, so it can be used in different situations. Additionally, this introduces the corrected midpoint logic favoring the lower half using `(len.saturating_sub(1)) / 2` into `halve_dimension` and `search_space.rs`. Bug: 487354432 Change-Id: Id831093c5963c720a3dca1cc5db8bd22d73255ee Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1550181 Reviewed-by: Aidan Wolter <awolter@google.com> Commit-Queue: Jerry Belton <jcecil@google.com>
Fuchsia is an open source, general purpose operating system supporting modern 64-bit Intel and ARM processors.
We expect everyone interacting with our project to respect our code of conduct.
Read more about Fuchsia's principles.
See Getting Started.
See fuchsia.dev.