Procházet zdrojové kódy

Delta compression: reuse DeltaTask.getAdjustedWeight()

Change-Id: I07ed5207b175735b4e2c46edf652cc35908dad02
Signed-off-by: Terry Parker <tparker@google.com>
tags/v4.2.0.201511101648-m1
Terry Parker před 8 roky
rodič
revize
36c6aecbe8

+ 1
- 1
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaTask.java Zobrazit soubor

@@ -226,7 +226,7 @@ final class DeltaTask implements Callable<Object> {
}
}

private static int getAdjustedWeight(ObjectToPack o) {
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()) {

+ 1
- 2
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java Zobrazit soubor

@@ -1306,8 +1306,7 @@ public class PackWriter implements AutoCloseable {
long totalWeight = 0;
for (int i = 0; i < cnt; i++) {
ObjectToPack o = list[i];
if (!o.isEdge() && !o.doNotAttemptDelta())
totalWeight += o.getWeight();
totalWeight += DeltaTask.getAdjustedWeight(o);
}

long bytesPerUnit = 1;

Načítá se…
Zrušit
Uložit