Make Log2Ceiling comparison explicit

PiperOrigin-RevId: 550585585
pull/13171/head
Hong Shin 2 years ago committed by Copybara-Service
parent e074c038c3
commit 9e92800395
  1. 2
      upb/base/log2.h

@ -41,7 +41,7 @@ UPB_INLINE int upb_Log2Ceiling(int x) {
return 32 - __builtin_clz(x - 1);
#else
int lg2 = 0;
while (1 << lg2 < x) lg2++;
while ((1 << lg2) < x) lg2++;
return lg2;
#endif
}

Loading…
Cancel
Save