From: Hector Caballero Date: Tue, 6 Feb 2018 11:20:19 +0000 (-0500) Subject: GC: Merge if statement with the enclosing one X-Git-Tag: v4.11.0.201803080745-r~118 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fchanges%2F87%2F116787%2F1;p=jgit.git GC: Merge if statement with the enclosing one Reported by Sonar. Signed-off-by: Hector Oswaldo Caballero Change-Id: Ib6fe6c67d6f7697e6d60693d5cee7e9c6a227767 --- diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java index d1c424c4ab..5669d49ae0 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java @@ -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(); } }