diff options
Diffstat (limited to 'contrib/llvm-project/libcxx/include/__algorithm/remove_if.h')
-rw-r--r-- | contrib/llvm-project/libcxx/include/__algorithm/remove_if.h | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/contrib/llvm-project/libcxx/include/__algorithm/remove_if.h b/contrib/llvm-project/libcxx/include/__algorithm/remove_if.h index 8197e4fc2f8e..6eceddce8d56 100644 --- a/contrib/llvm-project/libcxx/include/__algorithm/remove_if.h +++ b/contrib/llvm-project/libcxx/include/__algorithm/remove_if.h @@ -21,22 +21,18 @@ _LIBCPP_BEGIN_NAMESPACE_STD template <class _ForwardIterator, class _Predicate> _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator -remove_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) -{ - __first = std::find_if<_ForwardIterator, _Predicate&>(__first, __last, __pred); - if (__first != __last) - { - _ForwardIterator __i = __first; - while (++__i != __last) - { - if (!__pred(*__i)) - { - *__first = std::move(*__i); - ++__first; - } - } +remove_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) { + __first = std::find_if<_ForwardIterator, _Predicate&>(__first, __last, __pred); + if (__first != __last) { + _ForwardIterator __i = __first; + while (++__i != __last) { + if (!__pred(*__i)) { + *__first = std::move(*__i); + ++__first; + } } - return __first; + } + return __first; } _LIBCPP_END_NAMESPACE_STD |