Skip to content

Commit 4e24670

Browse files
committed
Remove unnecessary division and modulo operations in bitset
1 parent f84bc1c commit 4e24670

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libcxx/include/bitset

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,10 +464,10 @@ protected:
464464
return __const_reference(&__first_, __storage_type(1) << __pos);
465465
}
466466
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 __iterator __make_iter(size_t __pos) _NOEXCEPT {
467-
return __iterator(&__first_ + __pos / __bits_per_word, __pos % __bits_per_word);
467+
return __iterator(&__first_, __pos);
468468
}
469469
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 __const_iterator __make_iter(size_t __pos) const _NOEXCEPT {
470-
return __const_iterator(&__first_ + __pos / __bits_per_word, __pos % __bits_per_word);
470+
return __const_iterator(&__first_, __pos);
471471
}
472472

473473
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 void operator&=(const __bitset& __v) _NOEXCEPT;

0 commit comments

Comments
 (0)