aboutsummaryrefslogtreecommitdiff
path: root/libcxx/include/__algorithm/remove.h
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/include/__algorithm/remove.h')
-rw-r--r--libcxx/include/__algorithm/remove.h26
1 files changed, 11 insertions, 15 deletions
diff --git a/libcxx/include/__algorithm/remove.h b/libcxx/include/__algorithm/remove.h
index eff2275..2b9d4ff 100644
--- a/libcxx/include/__algorithm/remove.h
+++ b/libcxx/include/__algorithm/remove.h
@@ -22,22 +22,18 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _ForwardIterator, class _Tp>
_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator
-remove(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
-{
- __first = std::find(__first, __last, __value);
- if (__first != __last)
- {
- _ForwardIterator __i = __first;
- while (++__i != __last)
- {
- if (!(*__i == __value))
- {
- *__first = std::move(*__i);
- ++__first;
- }
- }
+remove(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) {
+ __first = std::find(__first, __last, __value);
+ if (__first != __last) {
+ _ForwardIterator __i = __first;
+ while (++__i != __last) {
+ if (!(*__i == __value)) {
+ *__first = std::move(*__i);
+ ++__first;
+ }
}
- return __first;
+ }
+ return __first;
}
_LIBCPP_END_NAMESPACE_STD