summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorHector Caballero <hector.caballero@ericsson.com>2018-02-06 06:20:19 -0500
committerHector Caballero <hector.caballero@ericsson.com>2018-02-06 08:41:41 -0500
commit6766fc85d06464402168e71e27a506eb2042b279 (patch)
tree3c0550acac7a61d2aa56def1f344af008f1e9644 /org.eclipse.jgit
parent4644d15bc5b8c9e66f3acc927fd06864cb742b3f (diff)
downloadjgit-6766fc85d06464402168e71e27a506eb2042b279.tar.gz
jgit-6766fc85d06464402168e71e27a506eb2042b279.zip
GC: Merge if statement with the enclosing one
Reported by Sonar. Signed-off-by: Hector Oswaldo Caballero <hector.caballero@ericsson.com> Change-Id: Ib6fe6c67d6f7697e6d60693d5cee7e9c6a227767
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java12
1 files changed, 6 insertions, 6 deletions
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();
}
}