Browse Source

GC: Merge if statement with the enclosing one

Reported by Sonar.

Signed-off-by: Hector Oswaldo Caballero <hector.caballero@ericsson.com>
Change-Id: Ib6fe6c67d6f7697e6d60693d5cee7e9c6a227767
stable-4.11
Hector Caballero 7 years ago
parent
commit
6766fc85d0
  1. 12
      org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java

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

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

Loading…
Cancel
Save