diff options
author | Hector Caballero <hector.caballero@ericsson.com> | 2018-01-29 20:51:14 -0500 |
---|---|---|
committer | Hector Caballero <hector.caballero@ericsson.com> | 2018-02-06 06:26:14 -0500 |
commit | e00a12f5a2c6113c6dcf15fd19addb3d053ccfc2 (patch) | |
tree | e7f1327f3e4b33ff8be24d46c71208e45c6b5ff5 /org.eclipse.jgit/src/org | |
parent | f58c3fce90daa92633a17b48feeeeae16db10341 (diff) | |
download | jgit-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.java | 15 |
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()); } /** |