Browse Source

Remove useless for(;;) loop

Change-Id: Ic9a7824cc178e92f44126acc8e77b0304b20ef4f
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
stable-4.11
Thomas Wolf 7 years ago committed by Matthias Sohn
parent
commit
e00f59b7fe
  1. 36
      org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RewriteGenerator.java

36
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RewriteGenerator.java

@ -93,27 +93,25 @@ class RewriteGenerator extends Generator {
@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;
}
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;
}
if (rewrote) {
c.parents = cleanup(pList);
}
return c;
}
private RevCommit rewrite(RevCommit p) {

Loading…
Cancel
Save