Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions stl/inc/algorithm
Original file line number Diff line number Diff line change
Expand Up @@ -2384,7 +2384,11 @@ namespace ranges {
// |=======|????????|========|??????...

--_Mid2;
if (!_STD invoke(_Pred, _STD invoke(_Proj, *_Mid2), _Val)) { // mismatch; skip past it
if (_STD invoke(_Pred, _STD invoke(_Proj, *_Mid2), _Val)) {
if (_Mid2 == _Mid1) { // [_Mid1, _Mid2) is empty, so [_First, _Last) all match
return {_STD move(_First), _STD move(_Last)};
}
} else { // mismatch; skip past it
++_Mid2;
const auto _Delta = _RANGES distance(_First, _Mid2);

Expand All @@ -2399,11 +2403,6 @@ namespace ranges {
_Mid1 = _Last;
_RANGES advance(_Last, _Delta);
_Mid2 = _Last;
continue;
}

if (_Mid2 == _Mid1) { // [_Mid1, _Mid2) is empty, so [_First, _Last) all match
return {_STD move(_First), _STD move(_Last)};
}
}
} else {
Expand Down