diff options
author | Thomas Wolf <thomas.wolf@paranor.ch> | 2018-03-05 20:49:29 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2018-03-07 23:56:35 +0100 |
commit | e00f59b7fe7467a930457962326ce5fd0ec63537 (patch) | |
tree | b354a49ba4081e5217c6394c239400de930448b9 /org.eclipse.jgit | |
parent | 7d3040368fa8e00c4dfcbd0b7d2d92768cfc2c7e (diff) | |
download | jgit-e00f59b7fe7467a930457962326ce5fd0ec63537.tar.gz jgit-e00f59b7fe7467a930457962326ce5fd0ec63537.zip |
Remove useless for(;;) loop
Change-Id: Ic9a7824cc178e92f44126acc8e77b0304b20ef4f
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RewriteGenerator.java | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RewriteGenerator.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RewriteGenerator.java index 3ab96ca228..f82301a82d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RewriteGenerator.java +++ b/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) { |