Browse Source

Renumber internal ObjectToPack flags

Now that WANT_WRITE is gone renumber the flags to move the unused
bit next to the type. Recluster AS_IS and DELTA_ATTEMPTED to be
next to each other since these bits are tested as a pair.

Change-Id: I42994b5ff1f67435e15c3f06d02e3b82141e8f08
stable-3.0
Shawn Pearce 12 years ago
parent
commit
6a5019f539
  1. 18
      org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/ObjectToPack.java

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

@ -57,26 +57,16 @@ import org.eclipse.jgit.transport.PackedObjectInfo;
* each object as they are written to the output stream. * each object as they are written to the output stream.
*/ */
public class ObjectToPack extends PackedObjectInfo { public class ObjectToPack extends PackedObjectInfo {
private static final int REUSE_AS_IS = 1 << 1; private static final int REUSE_AS_IS = 1 << 0;
private static final int DELTA_ATTEMPTED = 1 << 1;
private static final int DO_NOT_DELTA = 1 << 2; private static final int DO_NOT_DELTA = 1 << 2;
private static final int EDGE = 1 << 3; private static final int EDGE = 1 << 3;
private static final int DELTA_ATTEMPTED = 1 << 4;
private static final int ATTEMPT_DELTA_MASK = REUSE_AS_IS | DELTA_ATTEMPTED; private static final int ATTEMPT_DELTA_MASK = REUSE_AS_IS | DELTA_ATTEMPTED;
private static final int TYPE_SHIFT = 5; private static final int TYPE_SHIFT = 5;
private static final int EXT_SHIFT = 8; private static final int EXT_SHIFT = 8;
private static final int EXT_MASK = 0xf; private static final int EXT_MASK = 0xf;
private static final int DELTA_SHIFT = 12; private static final int DELTA_SHIFT = 12;
private static final int NON_EXT_MASK = ~(EXT_MASK << EXT_SHIFT); private static final int NON_EXT_MASK = ~(EXT_MASK << EXT_SHIFT);
private static final int NON_DELTA_MASK = 0xfff; private static final int NON_DELTA_MASK = 0xfff;
/** Other object being packed that this will delta against. */ /** Other object being packed that this will delta against. */
@ -85,11 +75,11 @@ public class ObjectToPack extends PackedObjectInfo {
/** /**
* Bit field, from bit 0 to bit 31: * Bit field, from bit 0 to bit 31:
* <ul> * <ul>
* <li>1 bit: unused</li>
* <li>1 bit: canReuseAsIs</li> * <li>1 bit: canReuseAsIs</li>
* <li>1 bit: deltaAttempted</li>
* <li>1 bit: doNotDelta</li> * <li>1 bit: doNotDelta</li>
* <li>1 bit: edgeObject</li> * <li>1 bit: edgeObject</li>
* <li>1 bit: deltaAttempted</li> * <li>1 bit: unused</li>
* <li>3 bits: type</li> * <li>3 bits: type</li>
* <li>4 bits: subclass flags (if any)</li> * <li>4 bits: subclass flags (if any)</li>
* <li>--</li> * <li>--</li>

Loading…
Cancel
Save