@@ -86,14 +86,12 @@ struct __fold_left_with_iter {
8686 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto operator ()(_Ip __first, _Sp __last, _Tp __init, _Fp __f) {
8787 using _Up = decay_t <invoke_result_t <_Fp&, _Tp, iter_reference_t <_Ip>>>;
8888
89- if (__first == __last) {
89+ if (__first == __last)
9090 return fold_left_with_iter_result<_Ip, _Up>{std::move (__first), _Up (std::move (__init))};
91- }
9291
9392 _Up __result = std::invoke (__f, std::move (__init), *__first);
94- for (++__first; __first != __last; ++__first) {
93+ for (++__first; __first != __last; ++__first)
9594 __result = std::invoke (__f, std::move (__result), *__first);
96- }
9795
9896 return fold_left_with_iter_result<_Ip, _Up>{std::move (__first), std::move (__result)};
9997 }
@@ -130,14 +128,12 @@ struct __fold_left_first_with_iter {
130128 using _Up = decltype (fold_left (std::move (__first), __last, iter_value_t <_Ip>(*__first), __f));
131129
132130 // case of empty range
133- if (__first == __last) {
131+ if (__first == __last)
134132 return fold_left_first_with_iter_result<_Ip, optional<_Up>>{std::move (__first), optional<_Up>()};
135- }
136133
137134 _Up __result (*__first);
138- for (++__first; __first != __last; ++__first) {
135+ for (++__first; __first != __last; ++__first)
139136 __result = std::invoke (__f, std::move (__result), *__first);
140- }
141137
142138 return fold_left_first_with_iter_result<_Ip, optional<_Up>>{std::move (__first), optional<_Up>(std::move (__result))};
143139 }
0 commit comments