]> source.dussan.org Git - jgit.git/commitdiff
Simplify setDoNotDelta() to always set the flag 50/11650/1
authorShawn Pearce <spearce@spearce.org>
Thu, 4 Apr 2013 17:53:22 +0000 (10:53 -0700)
committerShawn Pearce <spearce@spearce.org>
Thu, 4 Apr 2013 17:56:42 +0000 (10:56 -0700)
This method is only invoked with true as the argument.
Remove the unnecessary parameter and branch, making
the code easier for the JIT to optimize.

Change-Id: I68a9cd82f197b7d00a524ea3354260a0828083c6

org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/ObjectToPack.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java

index 0579fd8a78d5c5b949d41f3c6c02949876386534..847684fd6eac8c9e19e3fae8b06d3c38cd56bb21 100644 (file)
@@ -241,11 +241,8 @@ public class ObjectToPack extends PackedObjectInfo {
                return (flags & DO_NOT_DELTA) != 0;
        }
 
-       void setDoNotDelta(boolean noDelta) {
-               if (noDelta)
-                       flags |= DO_NOT_DELTA;
-               else
-                       flags &= ~DO_NOT_DELTA;
+       void setDoNotDelta() {
+               flags |= DO_NOT_DELTA;
        }
 
        boolean isEdge() {
index e9ca94ae0d768a6baefeebee6c8afa8291f56f29..cd8f462b22844f737b9d6db0b18fe82e0fbcc005 100644 (file)
@@ -1157,13 +1157,13 @@ public class PackWriter {
                                        if (ignoreMissingUninteresting) {
                                                ObjectToPack otp = sizeQueue.getCurrent();
                                                if (otp != null && otp.isEdge()) {
-                                                       otp.setDoNotDelta(true);
+                                                       otp.setDoNotDelta();
                                                        continue;
                                                }
 
                                                otp = objectsMap.get(notFound.getObjectId());
                                                if (otp != null && otp.isEdge()) {
-                                                       otp.setDoNotDelta(true);
+                                                       otp.setDoNotDelta();
                                                        continue;
                                                }
                                        }
@@ -1176,10 +1176,10 @@ public class PackWriter {
 
                                long sz = sizeQueue.getSize();
                                if (limit <= sz || Integer.MAX_VALUE <= sz)
-                                       otp.setDoNotDelta(true); // too big, avoid costly files
+                                       otp.setDoNotDelta(); // too big, avoid costly files
 
                                else if (sz <= DeltaIndex.BLKSZ)
-                                       otp.setDoNotDelta(true); // too small, won't work
+                                       otp.setDoNotDelta(); // too small, won't work
 
                                else
                                        otp.setWeight((int) sz);