]> source.dussan.org Git - jgit.git/commitdiff
RefWriter#writePackedRefs: Remove a redundant "if" check 67/197567/2
authorSergey <zakharovsergey1000@gmail.com>
Wed, 7 Dec 2022 11:49:47 +0000 (15:49 +0400)
committerMatthias Sohn <matthias.sohn@sap.com>
Thu, 8 Dec 2022 09:59:58 +0000 (10:59 +0100)
After checking the variable, the same variable was checked again inside
the "if" block, and after the first check, this variable does not
change. Remove the second unnecessary check.

Change-Id: I6a38e67073f7f93105575b8f415ad32d350af602

org.eclipse.jgit/src/org/eclipse/jgit/lib/RefWriter.java

index c80d80f607bb670626d2a71b2a008abac85bad6d..d2c3f9de68a2a958e4a7657ee686cc2413068819 100644 (file)
@@ -138,8 +138,7 @@ public abstract class RefWriter {
                final StringWriter w = new StringWriter();
                if (peeled) {
                        w.write(RefDirectory.PACKED_REFS_HEADER);
-                       if (peeled)
-                               w.write(RefDirectory.PACKED_REFS_PEELED);
+                       w.write(RefDirectory.PACKED_REFS_PEELED);
                        w.write('\n');
                }