Skip to content

Commit 1b3c154

Browse files
committed
Make variable constant expression
1 parent df5ae22 commit 1b3c154

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
@@ -416,7 +416,8 @@ __bitset<_N_words, _Size>::to_ullong(true_type, true_type) const {
416416
unsigned long long __r = __first_[0];
417417
_LIBCPP_DIAGNOSTIC_PUSH
418418
_LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wshift-count-overflow")
419-
size_t __n_words = std::min<size_t>(_N_words, sizeof(unsigned long long) / sizeof(__storage_type));
419+
const size_t __ull_words = sizeof(unsigned long long) / sizeof(__storage_type);
420+
const size_t __n_words = _N_words < __ull_words ? _N_words : __ull_words;
420421
for (size_t __i = 1; __i < __n_words; ++__i)
421422
__r |= static_cast<unsigned long long>(__first_[__i]) << (sizeof(__storage_type) * CHAR_BIT * __i);
422423
_LIBCPP_DIAGNOSTIC_POP

0 commit comments

Comments
 (0)