@@ -253,17 +253,14 @@ inline _LIBCPP_CONSTEXPR __bitset<_N_words, _Size>::__bitset() _NOEXCEPT
253253
254254template <size_t _N_words, size_t _Size>
255255void __bitset<_N_words, _Size>::__init(unsigned long long __v, false_type) _NOEXCEPT {
256- __storage_type __t [sizeof (unsigned long long ) / sizeof (__storage_type)];
257- size_t __sz = _Size;
258- for (size_t __i = 0 ; __i < sizeof (__t ) / sizeof (__t [0 ]); ++__i, __v >>= __bits_per_word, __sz -= __bits_per_word)
256+ size_t __ull = sizeof (unsigned long long ) / sizeof (__storage_type);
257+ for (size_t __i = 0 , __sz = _Size; __i < __ull; ++__i, __v >>= __bits_per_word, __sz -= __bits_per_word)
259258 if (__sz < __bits_per_word)
260- __t [__i] = static_cast <__storage_type>(__v) & (1ULL << __sz) - 1 ;
259+ __first_ [__i] = static_cast <__storage_type>(__v) & (1ULL << __sz) - 1 ;
261260 else
262- __t [__i] = static_cast <__storage_type>(__v);
261+ __first_ [__i] = static_cast <__storage_type>(__v);
263262
264- std::copy (__t , __t + sizeof (__t ) / sizeof (__t [0 ]), __first_);
265- std::fill (
266- __first_ + sizeof (__t ) / sizeof (__t [0 ]), __first_ + sizeof (__first_) / sizeof (__first_[0 ]), __storage_type (0 ));
263+ std::fill (__first_ + __ull, __first_ + _N_words, __storage_type (0 ));
267264}
268265
269266template <size_t _N_words, size_t _Size>
@@ -272,7 +269,7 @@ inline _LIBCPP_HIDE_FROM_ABI void __bitset<_N_words, _Size>::__init(unsigned lon
272269 if (_Size < __bits_per_word)
273270 __first_[0 ] &= (1ULL << _Size) - 1 ;
274271
275- std::fill (__first_ + 1 , __first_ + sizeof (__first_) / sizeof (__first_[ 0 ] ), __storage_type (0 ));
272+ std::fill (__first_ + 1 , __first_ + _N_words ), __storage_type (0 ));
276273}
277274
278275# endif // _LIBCPP_CXX03_LANG
0 commit comments