Remove useless for(;;) loop

Change-Id: Ic9a7824cc178e92f44126acc8e77b0304b20ef4f
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
This commit is contained in:
Thomas Wolf 2018-03-05 20:49:29 +01:00 committed by Matthias Sohn
parent 7d3040368f
commit e00f59b7fe
1 changed files with 18 additions and 20 deletions

View File

@ -93,27 +93,25 @@ int outputType() {
@Override
RevCommit next() throws MissingObjectException,
IncorrectObjectTypeException, IOException {
for (;;) {
final RevCommit c = source.next();
if (c == null)
return null;
boolean rewrote = false;
final RevCommit[] pList = c.parents;
final int nParents = pList.length;
for (int i = 0; i < nParents; i++) {
final RevCommit oldp = pList[i];
final RevCommit newp = rewrite(oldp);
if (oldp != newp) {
pList[i] = newp;
rewrote = true;
}
}
if (rewrote)
c.parents = cleanup(pList);
return c;
final RevCommit c = source.next();
if (c == null) {
return null;
}
boolean rewrote = false;
final RevCommit[] pList = c.parents;
final int nParents = pList.length;
for (int i = 0; i < nParents; i++) {
final RevCommit oldp = pList[i];
final RevCommit newp = rewrite(oldp);
if (oldp != newp) {
pList[i] = newp;
rewrote = true;
}
}
if (rewrote) {
c.parents = cleanup(pList);
}
return c;
}
private RevCommit rewrite(RevCommit p) {