mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-10-07 00:50:56 +00:00
Update BitHelpers.h
This commit is contained in:
parent
49d32cc815
commit
ae572c3a7e
@ -23,7 +23,7 @@ inline unsigned int bitScanReverse(unsigned int x)
|
||||
inline size_t roundUpToPowerOfTwoOrZero(size_t n)
|
||||
{
|
||||
// if MSB is set, return n, to avoid return zero
|
||||
if (unlikely(n & 1ULL<<(sizeof(size_t)*CHAR_BIT-1)))
|
||||
if (unlikely(n >= 0x8000000000000000ULL))
|
||||
return n;
|
||||
|
||||
--n;
|
||||
|
Loading…
Reference in New Issue
Block a user