aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2019-06-12 13:10:32 +0900
committerMatthias Sohn <matthias.sohn@sap.com>2019-06-15 21:55:39 +0200
commit858736df37dd9d1b60f6173efae791912dd14d67 (patch)
treea234b660666c55c899d54d6db77413432acb3b7c /org.eclipse.jgit/src
parentf3b7c2beaebfe3a68b51df74e8ae5183f08a55b3 (diff)
downloadjgit-858736df37dd9d1b60f6173efae791912dd14d67.tar.gz
jgit-858736df37dd9d1b60f6173efae791912dd14d67.zip
PackWriter: Prefer boolean operators over logical operators in comparisons
Using the | and & operators in boolean conditions results in a warning from Error Prone: [ShortCircuitBoolean] Prefer the short-circuiting boolean operators && and || to & and |. see https://errorprone.info/bugpattern/ShortCircuitBoolean Change-Id: I4275c60306e43c74030c4465ba02cb853ad444e1 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit/src')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java4
1 files changed, 2 insertions, 2 deletions
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 714e8308f4..6506789218 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
@@ -2198,7 +2198,7 @@ public class PackWriter implements AutoCloseable {
if (!cachedPacks.isEmpty()) {
if (otp.isEdge())
return;
- if ((nFmt == PACK_WHOLE) | (nFmt == PACK_DELTA)) {
+ if (nFmt == PACK_WHOLE || nFmt == PACK_DELTA) {
for (CachedPack pack : cachedPacks) {
if (pack.hasObject(otp, next)) {
otp.setEdge();
@@ -2241,7 +2241,7 @@ public class PackWriter implements AutoCloseable {
otp.clearReuseAsIs();
}
- otp.setDeltaAttempted(reuseDeltas & next.wasDeltaAttempted());
+ otp.setDeltaAttempted(reuseDeltas && next.wasDeltaAttempted());
otp.select(next);
}