Mercurial > hg
comparison mercurial/parsers.c @ 26079:cefd5c8bab5d
reachableroots: narrow scope of minidx variable
minidx is never used if includepath is false, so let's define it where it
is used.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Fri, 14 Aug 2015 12:22:08 +0900 |
parents | e7e7182564f6 |
children | 83c9edcac05c |
comparison
equal
deleted
inserted
replaced
26078:5ca587348875 | 26079:cefd5c8bab5d |
---|---|
1125 long revnum; | 1125 long revnum; |
1126 Py_ssize_t k; | 1126 Py_ssize_t k; |
1127 Py_ssize_t i; | 1127 Py_ssize_t i; |
1128 Py_ssize_t l; | 1128 Py_ssize_t l; |
1129 int r; | 1129 int r; |
1130 int minidx; | |
1131 int parents[2]; | 1130 int parents[2]; |
1132 | 1131 |
1133 /* Internal data structure: | 1132 /* Internal data structure: |
1134 * tovisit: array of length len+1 (all revs + nullrev), filled upto lentovisit | 1133 * tovisit: array of length len+1 (all revs + nullrev), filled upto lentovisit |
1135 * revstates: array of length len+1 (all revs + nullrev) */ | 1134 * revstates: array of length len+1 (all revs + nullrev) */ |
1227 } | 1226 } |
1228 | 1227 |
1229 /* Find all the nodes in between the roots we found and the heads | 1228 /* Find all the nodes in between the roots we found and the heads |
1230 * and add them to the reachable set */ | 1229 * and add them to the reachable set */ |
1231 if (includepath == 1) { | 1230 if (includepath == 1) { |
1232 minidx = minroot; | 1231 int minidx = minroot; |
1233 if (minidx < 0) | 1232 if (minidx < 0) |
1234 minidx = 0; | 1233 minidx = 0; |
1235 for (i = minidx; i < len; i++) { | 1234 for (i = minidx; i < len; i++) { |
1236 if (!(revstates[i + 1] & RS_SEEN)) | 1235 if (!(revstates[i + 1] & RS_SEEN)) |
1237 continue; | 1236 continue; |