]> source.dussan.org Git - jgit.git/commitdiff
Delta compression: reuse DeltaTask.getAdjustedWeight() 14/59614/1
authorTerry Parker <tparker@google.com>
Tue, 3 Nov 2015 23:08:32 +0000 (15:08 -0800)
committerTerry Parker <tparker@google.com>
Tue, 3 Nov 2015 23:10:02 +0000 (15:10 -0800)
Change-Id: I07ed5207b175735b4e2c46edf652cc35908dad02
Signed-off-by: Terry Parker <tparker@google.com>
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaTask.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java

index 076df1880014e54fe5c7575141a086efa4f28c9e..42927426b9e3445011469f93d442e57757ee1c69 100644 (file)
@@ -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()) {
index f087aca05b2cd39a337a279674be1e58ce388025..19b6b080da1685e507ab61625017e7fd5b5972a9 100644 (file)
@@ -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;