From aa9bcf08fcf576826a9021df77929ec4bc944af1 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 3 Nov 2017 21:51:10 +0800 Subject: [PATCH] Code style tweak --- src/changes.hh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/changes.hh b/src/changes.hh index 963ca786..c89ea529 100644 --- a/src/changes.hh +++ b/src/changes.hh @@ -56,19 +56,17 @@ void update_backward(ConstArrayView changes, RangeContainer& ran { ForwardChangesTracker changes_tracker; - using ReverseIt = std::reverse_iterator; - auto change_it = ReverseIt(changes.end()); - auto change_end = ReverseIt(changes.begin()); - auto advance_while_relevant = [&](const BufferCoord& pos) mutable { - while (change_it != change_end) + auto advance_while_relevant = [&, it = changes.rbegin(), end = changes.rend()] + (const BufferCoord& pos) mutable { + while (it != end) { - auto change = *change_it; + auto change = *it; change.begin = changes_tracker.get_new_coord(change.begin); change.end = changes_tracker.get_new_coord(change.end); if (not changes_tracker.relevant(change, pos)) break; changes_tracker.update(change); - ++change_it; + ++it; } };