Brush up some more code

This commit is contained in:
Justine Tunney 2023-07-10 10:16:55 -07:00
parent ee6566a152
commit a2d269dc38
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
32 changed files with 251 additions and 335 deletions

View file

@ -399,7 +399,7 @@ int iswseparator(wint_t c) {
l = 0;
r = n = sizeof(kCodes) / sizeof(kCodes[0]);
while (l < r) {
m = (l + r) >> 1;
m = (l & r) + ((l ^ r) >> 1); // floor((a+b)/2)
if (kCodes[m][1] < c) {
l = m + 1;
} else {
@ -411,7 +411,7 @@ int iswseparator(wint_t c) {
l = 0;
r = n = sizeof(kAstralCodes) / sizeof(kAstralCodes[0]);
while (l < r) {
m = (l + r) >> 1;
m = (l & r) + ((l ^ r) >> 1); // floor((a+b)/2)
if (kAstralCodes[m][1] < c) {
l = m + 1;
} else {