]> source.dussan.org Git - jgit.git/commitdiff
GC: Merge if statement with the enclosing one 87/116787/1
authorHector Caballero <hector.caballero@ericsson.com>
Tue, 6 Feb 2018 11:20:19 +0000 (06:20 -0500)
committerHector Caballero <hector.caballero@ericsson.com>
Tue, 6 Feb 2018 13:41:41 +0000 (08:41 -0500)
Reported by Sonar.

Signed-off-by: Hector Oswaldo Caballero <hector.caballero@ericsson.com>
Change-Id: Ib6fe6c67d6f7697e6d60693d5cee7e9c6a227767

org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java

index d1c424c4abc0b81f1e17323e032e6b959ce58359..5669d49ae0afc61fa91922b86bdb3e326d34452f 100644 (file)
@@ -751,17 +751,17 @@ public class GC {
                RevObject ro = w.next();
                while (ro != null) {
                        checkCancelled();
-                       if (id2File.remove(ro.getId()) != null)
-                               if (id2File.isEmpty())
-                                       return;
+                       if (id2File.remove(ro.getId()) != null && id2File.isEmpty()) {
+                               return;
+                       }
                        ro = w.next();
                }
                ro = w.nextObject();
                while (ro != null) {
                        checkCancelled();
-                       if (id2File.remove(ro.getId()) != null)
-                               if (id2File.isEmpty())
-                                       return;
+                       if (id2File.remove(ro.getId()) != null && id2File.isEmpty()) {
+                               return;
+                       }
                        ro = w.nextObject();
                }
        }