aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org
diff options
context:
space:
mode:
authorHector Caballero <hector.caballero@ericsson.com>2018-01-29 20:51:14 -0500
committerHector Caballero <hector.caballero@ericsson.com>2018-02-06 06:26:14 -0500
commite00a12f5a2c6113c6dcf15fd19addb3d053ccfc2 (patch)
treee7f1327f3e4b33ff8be24d46c71208e45c6b5ff5 /org.eclipse.jgit/src/org
parentf58c3fce90daa92633a17b48feeeeae16db10341 (diff)
downloadjgit-e00a12f5a2c6113c6dcf15fd19addb3d053ccfc2.tar.gz
jgit-e00a12f5a2c6113c6dcf15fd19addb3d053ccfc2.zip
GC: Simplify reference equals() method
Signed-off-by: Hector Oswaldo Caballero <hector.caballero@ericsson.com> Change-Id: I5b2e12e012d5423e9b84c1c66a478960121ea212
Diffstat (limited to 'org.eclipse.jgit/src/org')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java15
1 files changed, 6 insertions, 9 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 d921bc89ec..2be38b980e 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
@@ -768,18 +768,15 @@ public class GC {
}
private static boolean equals(Ref r1, Ref r2) {
- if (r1 == null || r2 == null)
+ if (r1 == null || r2 == null) {
return false;
+ }
if (r1.isSymbolic()) {
- if (!r2.isSymbolic())
- return false;
- return r1.getTarget().getName().equals(r2.getTarget().getName());
- } else {
- if (r2.isSymbolic()) {
- return false;
- }
- return Objects.equals(r1.getObjectId(), r2.getObjectId());
+ return r2.isSymbolic() && r1.getTarget().getName()
+ .equals(r2.getTarget().getName());
}
+ return !r2.isSymbolic()
+ && Objects.equals(r1.getObjectId(), r2.getObjectId());
}
/**