Skip to content

Commit dd930d7

Browse files
Adopt @philnik777's review comments
1 parent 817b7aa commit dd930d7

File tree

1 file changed

+1
-2
lines changed
  • libcxx/include/__algorithm

1 file changed

+1
-2
lines changed

libcxx/include/__algorithm/sort.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -861,8 +861,7 @@ template <class _AlgPolicy, class _RandomAccessIterator, class _Comp>
861861
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
862862
__sort_dispatch(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp& __comp) {
863863
typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
864-
difference_type __depth_limit = static_cast<difference_type>(
865-
2 * std::__bit_log2(static_cast<__make_unsigned_t<difference_type> >(__last - __first)));
864+
difference_type __depth_limit = 2 * std::__bit_log2(std::__to_unsigned_like(__last - __first));
866865

867866
// Only use bitset partitioning for arithmetic types. We should also check
868867
// that the default comparator is in use so that we are sure that there are no

0 commit comments

Comments
 (0)