mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-17 08:00:32 +00:00
Brush up some more code
This commit is contained in:
parent
ee6566a152
commit
a2d269dc38
32 changed files with 251 additions and 335 deletions
|
@ -669,7 +669,7 @@ static long FindRedirect(const char *s, size_t n) {
|
|||
l = 0;
|
||||
r = redirects.n - 1;
|
||||
while (l <= r) {
|
||||
m = (l + r) >> 1;
|
||||
m = (l & r) + ((l ^ r) >> 1); // floor((a+b)/2)
|
||||
c = CompareSlices(redirects.p[m].path.s, redirects.p[m].path.n, s, n);
|
||||
if (c < 0) {
|
||||
l = m + 1;
|
||||
|
@ -5381,7 +5381,7 @@ static bool ShouldAutocomplete(const char *s) {
|
|||
l = 0;
|
||||
r = ARRAYLEN(kDontAutoComplete) - 1;
|
||||
while (l <= r) {
|
||||
m = (l + r) >> 1;
|
||||
m = (l & r) + ((l ^ r) >> 1); // floor((a+b)/2)
|
||||
c = strcmp(kDontAutoComplete[m], s);
|
||||
if (c < 0) {
|
||||
l = m + 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue