Skip to content

Commit a62e6a4

Browse files
committed
Make variable constant expression
1 parent f95a580 commit a62e6a4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libcxx/include/bitset

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,8 @@ __bitset<_N_words, _Size>::to_ullong(true_type, true_type) const {
383383
unsigned long long __r = __first_[0];
384384
_LIBCPP_DIAGNOSTIC_PUSH
385385
_LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wshift-count-overflow")
386-
size_t __n_words = std::min<size_t>(_N_words, sizeof(unsigned long long) / sizeof(__storage_type));
386+
const size_t __ull_words = sizeof(unsigned long long) / sizeof(__storage_type);
387+
const size_t __n_words = _N_words < __ull_words ? _N_words : __ull_words;
387388
for (size_t __i = 1; __i < __n_words; ++__i)
388389
__r |= static_cast<unsigned long long>(__first_[__i]) << (sizeof(__storage_type) * CHAR_BIT * __i);
389390
_LIBCPP_DIAGNOSTIC_POP

0 commit comments

Comments
 (0)