summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Pearce <spearce@spearce.org>2013-04-04 10:53:22 -0700
committerShawn Pearce <spearce@spearce.org>2013-04-04 10:56:42 -0700
commit594d4ceb12aa0e8df9dfe964de620de8dd6d79f5 (patch)
treeb4ae61647a25cf9c1a57d3de36296e23cc41ad68
parent545358577376bec8fc140a76ce0f72bf81cc0a94 (diff)
downloadjgit-594d4ceb12aa0e8df9dfe964de620de8dd6d79f5.tar.gz
jgit-594d4ceb12aa0e8df9dfe964de620de8dd6d79f5.zip
Simplify setDoNotDelta() to always set the flag
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
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/ObjectToPack.java7
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java8
2 files changed, 6 insertions, 9 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/ObjectToPack.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/ObjectToPack.java
index 0579fd8a78..847684fd6e 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/ObjectToPack.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/ObjectToPack.java
@@ -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() {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java
index e9ca94ae0d..cd8f462b22 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java
@@ -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);