about summary refs log tree commit diff
path: root/src/stdlib/bsearch.c
Commit message (Collapse)AuthorAgeFilesLines
* bsearch: simplify and optimizeFangrui Song2018-07-231-6/+6
| | | | | | | | | | maintainer's note: the key observation here is that the compared element is the first slot of the second ceil(half) of the array, and thus can be removed for further comparison when it does not match, so that we descend into the second ceil(half)-1 rather than ceil(half) elements. this change ensures that nel strictly decreases with each iteration, so that the case of != but nel==1 does not need to be special-cased anymore.
* initial check-in, version 0.5.0 v0.5.0Rich Felker2011-02-121-0/+20