Skip to content

Commit acff5cf

Browse files
committed
Remove unnecessary division and modulo operations in bitset
1 parent bee9664 commit acff5cf

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
@@ -465,10 +465,10 @@ protected:
465465
return __const_reference(&__first_, __storage_type(1) << __pos);
466466
}
467467
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 __iterator __make_iter(size_t __pos) _NOEXCEPT {
468-
return __iterator(&__first_ + __pos / __bits_per_word, __pos % __bits_per_word);
468+
return __iterator(&__first_, __pos);
469469
}
470470
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 __const_iterator __make_iter(size_t __pos) const _NOEXCEPT {
471-
return __const_iterator(&__first_ + __pos / __bits_per_word, __pos % __bits_per_word);
471+
return __const_iterator(&__first_, __pos);
472472
}
473473

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

0 commit comments

Comments
 (0)