Преглед изворни кода

Remove getReverseIndexSize() from DfsPackDescription.

The method is used in only one location (DfsPackFile). Furthermore,
PackIndex already does an explicit computation of the size in
DfsPackFile. Simplify the DfsPackDescription by removing the method
and do the calculation similar to PackIndex.

Change-Id: I1391fdaaf7c2c3226d96ada1ae8647bcdff4794e
tags/v2.3.0.201302130906
Colby Ranger пре 11 година
родитељ
комит
3f0176aea6

+ 0
- 7
org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsPackDescription.java Прегледај датотеку

@@ -168,13 +168,6 @@ public class DfsPackDescription implements Comparable<DfsPackDescription> {
return size == null ? 0 : size.longValue();
}

/**
* @return size of the reverse index, in bytes.
*/
public int getReverseIndexSize() {
return (int) Math.min(objectCount * 8, Integer.MAX_VALUE);
}

/** @return number of objects in the pack. */
public long getObjectCount() {
return objectCount;

+ 5
- 3
org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsPackFile.java Прегледај датотеку

@@ -283,9 +283,11 @@ public final class DfsPackFile {
return revidx;
}

PackReverseIndex revidx = new PackReverseIndex(idx(ctx));
reverseIndex = cache.put(key, POS_REVERSE_INDEX,
packDesc.getReverseIndexSize(), revidx);
PackIndex idx = idx(ctx);
PackReverseIndex revidx = new PackReverseIndex(idx);
int sz = (int) Math.min(
idx.getObjectCount() * 8, Integer.MAX_VALUE);
reverseIndex = cache.put(key, POS_REVERSE_INDEX, sz, revidx);
return revidx;
}
}

Loading…
Откажи
Сачувај