aboutsummaryrefslogtreecommitdiffstats
path: root/include/__hash_table
diff options
context:
space:
mode:
Diffstat (limited to 'include/__hash_table')
-rw-r--r--include/__hash_table2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/__hash_table b/include/__hash_table
index 79336ff793ec..3f430af1283e 100644
--- a/include/__hash_table
+++ b/include/__hash_table
@@ -137,7 +137,7 @@ inline _LIBCPP_INLINE_VISIBILITY
size_t
__next_hash_pow2(size_t __n)
{
- return size_t(1) << (std::numeric_limits<size_t>::digits - __clz(__n-1));
+ return __n < 2 ? __n : (size_t(1) << (std::numeric_limits<size_t>::digits - __clz(__n-1)));
}