summaryrefslogtreecommitdiff
path: root/methods/rred.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-01-25 22:13:52 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2016-01-26 15:32:15 +0100
commit2651f1c071927b7fc440ec7a638ecad7ccf04a2e (patch)
treec2b4f94c949590c4689c1509b490b4c9d4cc9bc7 /methods/rred.cc
parent3b0e76ec9c9386e428944f621b970d691884b84a (diff)
act on various suggestions from cppcheck
Reported-By: cppcheck Git-Dch: Ignore
Diffstat (limited to 'methods/rred.cc')
-rw-r--r--methods/rred.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/methods/rred.cc b/methods/rred.cc
index 85ec30bd5..e568c75b2 100644
--- a/methods/rred.cc
+++ b/methods/rred.cc
@@ -491,7 +491,11 @@ class Patch {
for (ch = filechanges.rbegin(); ch != filechanges.rend(); ++ch) {
std::list<struct Change>::reverse_iterator mg_i, mg_e = ch;
while (ch->del_cnt == 0 && ch->offset == 0)
+ {
++ch;
+ if (unlikely(ch == filechanges.rend()))
+ return;
+ }
line -= ch->del_cnt;
std::string buf;
if (ch->add_cnt > 0) {