summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Nieder <jrn@google.com>2015-11-03 21:42:28 -0800
committerJonathan Nieder <jrn@google.com>2015-11-05 12:40:13 -0800
commit42f0a3d51df967d0f06b29221f768d2c94cd7cd0 (patch)
tree5ebfeb2b7208076d8ec24c4fffb05491f14b8d69
parent73474466ebcccbeeef21461f0df5839569151c29 (diff)
downloadjgit-42f0a3d51df967d0f06b29221f768d2c94cd7cd0.tar.gz
jgit-42f0a3d51df967d0f06b29221f768d2c94cd7cd0.zip
Remove BitmapRevFilter.getCountOfLoadedCommits
The count of loaded commits is equal to the number of commits returned by the walk. Simplify BitmapRevFilter by counting them in the caller. Change-Id: Ia95da47831d9e89d6f8068470ec4529aaabfa7dd
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriterBitmapWalker.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriterBitmapWalker.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriterBitmapWalker.java
index debb2f2abc..cd18a9c5cd 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriterBitmapWalker.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriterBitmapWalker.java
@@ -116,7 +116,15 @@ final class PackWriterBitmapWalker {
while (walker.next() != null) {
// Iterate through all of the commits. The BitmapRevFilter does
// the work.
+ //
+ // filter.include returns true for commits that do not have
+ // a bitmap in bitmapIndex and are not reachable from a
+ // bitmap in bitmapIndex encountered earlier in the walk.
+ // Thus the number of commits returned by next() measures how
+ // much history was traversed without being able to make use
+ // of bitmaps.
pm.update(1);
+ countOfBitmapIndexMisses++;
}
RevObject ro;
@@ -124,7 +132,6 @@ final class PackWriterBitmapWalker {
bitmapResult.add(ro, ro.getType());
pm.update(1);
}
- countOfBitmapIndexMisses += filter.getCountOfLoadedCommits();
}
return bitmapResult;
@@ -154,14 +161,11 @@ final class PackWriterBitmapWalker {
}
static abstract class BitmapRevFilter extends RevFilter {
- private long countOfLoadedCommits;
-
protected abstract boolean load(RevCommit cmit);
@Override
public final boolean include(RevWalk walker, RevCommit cmit) {
if (load(cmit)) {
- countOfLoadedCommits++;
return true;
}
for (RevCommit p : cmit.getParents())
@@ -178,9 +182,5 @@ final class PackWriterBitmapWalker {
public final boolean requiresCommitBody() {
return false;
}
-
- long getCountOfLoadedCommits() {
- return countOfLoadedCommits;
- }
}
}