private static void pruneEdgesFromObjectList(List<ObjectToPack> list) { final int size = list.size(); int src = 0; int dst = 0; for (; src < size; src++) { ObjectToPack obj = list.get(src); if (obj.isEdge()) continue; if (dst != src) list.set(dst, obj); dst++; } while (dst < list.size()) list.remove(list.size() - 1); }
/** * Lookup the ObjectToPack object for a given ObjectId. * * @param id * the object to find in the pack. * @return the object we are packing, or null. */ public ObjectToPack get(AnyObjectId id) { ObjectToPack obj = objectsMap.get(id); return obj != null && !obj.isEdge() ? obj : null; }
/** * Determine if the pack file will contain the requested object. * * @param id * the object to test the existence of. * @return true if the object will appear in the output pack file. * @throws java.io.IOException * a cached pack cannot be examined. */ public boolean willInclude(AnyObjectId id) throws IOException { ObjectToPack obj = objectsMap.get(id); return obj != null && !obj.isEdge(); }
private final boolean have(ObjectToPack ptr, AnyObjectId objectId) { return (ptr != null && ptr.isEdge()) || (haveObjects != null && haveObjects.contains(objectId)); }
private void writeBase(PackOutputStream out, ObjectToPack base) throws IOException { if (base != null && !base.isWritten() && !base.isEdge()) writeObjectImpl(out, base); }
static int getAdjustedWeight(ObjectToPack o) { // Edge objects and those with reused deltas do not need to be // compressed. For compression calculations, ignore their weights. if (o.isEdge() || o.doNotAttemptDelta()) { return 0; } return o.getWeight(); }
if (isDoNotDelta()) buf.append(" doNotDelta"); if (isEdge()) buf.append(" edge"); if (getDeltaDepth() > 0)
@Override public int compare(ObjectToPack a, ObjectToPack b) { int cmp = (a.isDoNotDelta() ? 1 : 0) - (b.isDoNotDelta() ? 1 : 0); if (cmp != 0) return cmp; cmp = a.getType() - b.getType(); if (cmp != 0) return cmp; cmp = (a.getPathHash() >>> 1) - (b.getPathHash() >>> 1); if (cmp != 0) return cmp; cmp = (a.getPathHash() & 1) - (b.getPathHash() & 1); if (cmp != 0) return cmp; cmp = (a.isEdge() ? 0 : 1) - (b.isEdge() ? 0 : 1); if (cmp != 0) return cmp; return b.getWeight() - a.getWeight(); } });
if (ignoreMissingUninteresting) { ObjectToPack otp = sizeQueue.getCurrent(); if (otp != null && otp.isEdge()) { otp.setDoNotDelta(); continue; if (otp != null && otp.isEdge()) { otp.setDoNotDelta(); continue; if (!list[cnt - 1].isEdge()) nonEdgeCnt--; cnt--; if (!list[i].isEdge() && list[i].isDeltaRepresentation()) stats.deltasFound++;
clearWindowOnTypeSwitch(); if (res.object.isEdge() || res.object.doNotAttemptDelta()) {
if (src.object.isEdge()) // Missing edges are OK. return NEXT_SRC; throw notAvailable;
if (srcObj.isEdge()) {
/** * Lookup the ObjectToPack object for a given ObjectId. * * @param id * the object to find in the pack. * @return the object we are packing, or null. */ public ObjectToPack get(AnyObjectId id) { ObjectToPack obj = objectsMap.get(id); return obj != null && !obj.isEdge() ? obj : null; }
/** * Lookup the ObjectToPack object for a given ObjectId. * * @param id * the object to find in the pack. * @return the object we are packing, or null. */ public ObjectToPack get(AnyObjectId id) { ObjectToPack obj = objectsMap.get(id); return obj != null && !obj.isEdge() ? obj : null; }
/** * Determine if the pack file will contain the requested object. * * @param id * the object to test the existence of. * @return true if the object will appear in the output pack file. * @throws IOException * a cached pack cannot be examined. */ public boolean willInclude(final AnyObjectId id) throws IOException { ObjectToPack obj = objectsMap.get(id); return obj != null && !obj.isEdge(); }
private void writeBase(PackOutputStream out, ObjectToPack base) throws IOException { if (base != null && !base.isWritten() && !base.isEdge()) writeObjectImpl(out, base); }
static int getAdjustedWeight(ObjectToPack o) { // Edge objects and those with reused deltas do not need to be // compressed. For compression calculations, ignore their weights. if (o.isEdge() || o.doNotAttemptDelta()) { return 0; } return o.getWeight(); }
private void writeBase(PackOutputStream out, ObjectToPack base) throws IOException { if (base != null && !base.isWritten() && !base.isEdge()) writeObjectImpl(out, base); }
static int getAdjustedWeight(ObjectToPack o) { // Edge objects and those with reused deltas do not need to be // compressed. For compression calculations, ignore their weights. if (o.isEdge() || o.doNotAttemptDelta()) { return 0; } return o.getWeight(); }