Skip to content

Commit

Permalink
Minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
miscco committed Oct 9, 2020
1 parent 503d11e commit d2b1d42
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
7 changes: 3 additions & 4 deletions stl/inc/algorithm
Original file line number Diff line number Diff line change
Expand Up @@ -1852,16 +1852,15 @@ namespace ranges {
_NODISCARD constexpr _It2 _Move_backward_common(const _It1 _First, _It1 _Last, _It2 _Result) {
// clang-format on
if constexpr (_Ptr_move_cat<_It1, _It2>::_Trivially_copyable) {
#ifdef __cpp_lib_is_constant_evaluated
if (!_STD is_constant_evaluated())
#endif // __cpp_lib_is_constant_evaluated
{
if (!_STD is_constant_evaluated()) {
return _Memmove_backward(_First, _Last, _Result);
}
}

while (_First != _Last) {
*--_Result = _RANGES iter_move(--_Last);
}

return _Result;
}

Expand Down
5 changes: 2 additions & 3 deletions stl/inc/vector
Original file line number Diff line number Diff line change
Expand Up @@ -635,8 +635,7 @@ private:
_Clear_and_reserve_geometric(_Newsize);
}

_Mylast = _Refancy<pointer>(
_Uninitialized_move_unchecked(_Unfancy(_First), _Unfancy(_Last), _Unfancy(_Myfirst)));
_Mylast = _Refancy<pointer>(_Memmove_forward(_Unfancy(_First), _Unfancy(_Last), _Unfancy(_Myfirst)));
} else
#endif // _HAS_IF_CONSTEXPR
{
Expand Down Expand Up @@ -1110,7 +1109,7 @@ private:
_Clear_and_reserve_geometric(_Newsize);
}

_Mylast = _Refancy<pointer>(_Uninitialized_copy_unchecked(_First, _Last, _Unfancy(_Myfirst)));
_Mylast = _Refancy<pointer>(_Memmove_forward(_First, _Last, _Unfancy(_Myfirst)));
} else
#endif // _HAS_IF_CONSTEXPR
{
Expand Down

0 comments on commit d2b1d42

Please sign in to comment.