Browse Source

PackOutputStream: Add comment for intentional use of non-short-circuit logic

To avoid that people try to "fix" it.

Change-Id: Ib4b35e357e4c068a17243ebd2d57b058c54d5834
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
stable-4.6
David Pursehouse 8 years ago
parent
commit
e9107e853f
  1. 2
      org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackOutputStream.java

2
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackOutputStream.java

@ -183,7 +183,7 @@ public final class PackOutputStream extends OutputStream {
public final void writeHeader(ObjectToPack otp, long rawLength) public final void writeHeader(ObjectToPack otp, long rawLength)
throws IOException { throws IOException {
ObjectToPack b = otp.getDeltaBase(); ObjectToPack b = otp.getDeltaBase();
if (b != null && (b.isWritten() & ofsDelta)) { if (b != null && (b.isWritten() & ofsDelta)) { // Non-short-circuit logic is intentional
int n = objectHeader(rawLength, OBJ_OFS_DELTA, headerBuffer); int n = objectHeader(rawLength, OBJ_OFS_DELTA, headerBuffer);
n = ofsDelta(count - b.getOffset(), headerBuffer, n); n = ofsDelta(count - b.getOffset(), headerBuffer, n);
write(headerBuffer, 0, n); write(headerBuffer, 0, n);

Loading…
Cancel
Save