Commit 8fdd5f1b authored by Christopher Dykes's avatar Christopher Dykes Committed by Facebook Github Bot 6

Fix nextPowTwo for 64-bit values under MSVC

Summary: A `long` is only 32-bits on MSVC, so this is simply wrong. Shift a `T` left instead.

Reviewed By: yfeldblum

Differential Revision: D3651139

fbshipit-source-id: 3bbfd18ed0c372287c4ec6cbcc543f6f1fcc4139
parent 800802c8
......@@ -185,7 +185,7 @@ typename std::enable_if<
std::is_integral<T>::value && std::is_unsigned<T>::value,
T>::type
nextPowTwo(T v) {
return v ? (1ul << findLastSet(v - 1)) : 1;
return v ? (T(1) << findLastSet(v - 1)) : 1;
}
template <class T>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment