Skip to content

Commit 4cb1674

Browse files
committed
Cleanup floor_log2
1 parent 4cfd465 commit 4cb1674

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

include/oup/observable_unique_ptr.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ namespace details {
4747
Bits <= 32, std::uint_least32_t, std::conditional_t<
4848
Bits <= 64, std::uint_least64_t, std::size_t>>>> {};
4949

50-
// courtesy of https://stackoverflow.com/a/23782939
50+
// Courtesy of https://stackoverflow.com/a/23782939
5151
constexpr std::size_t floor_log2(std::size_t x)
5252
{
53-
return x == 1 ? 0 : 1+floor_log2(x >> 1);
53+
return x == 1 ? 0 : 1 + floor_log2(x >> 1);
5454
}
5555

5656
constexpr std::size_t ceil_log2(std::size_t x)
5757
{
58-
return x == 1 ? 0 : floor_log2(x - 1) + 1;
58+
return x == 1 ? 0 : 1 + floor_log2(x - 1);
5959
}
6060
}
6161

0 commit comments

Comments
 (0)