@ -110,8 +110,12 @@ final class PackWriterBitmapWalker {
}
if ( marked ) {
RevFilter filter = newRevFilter ( seen , bitmapResult ) ;
walker . setRevFilter ( filter ) ;
if ( seen = = null ) {
walker . setRevFilter ( new AddToBitmapFilter ( bitmapResult ) ) ;
} else {
walker . setRevFilter (
new AddUnseenToBitmapFilter ( seen , bitmapResult ) ) ;
}
while ( walker . next ( ) ! = null ) {
// Iterate through all of the commits. The BitmapRevFilter does
@ -141,13 +145,6 @@ final class PackWriterBitmapWalker {
walker . reset ( ) ;
}
static RevFilter newRevFilter ( BitmapBuilder seen , BitmapBuilder bitmapResult ) {
if ( seen ! = null ) {
return new AddUnseenToBitmapFilter ( seen , bitmapResult ) ;
}
return new AddToBitmapFilter ( bitmapResult ) ;
}
/ * *
* A RevFilter that adds the visited commits to { @code bitmap } as a side
* effect .
@ -158,7 +155,7 @@ final class PackWriterBitmapWalker {
* have to visit its ancestors . This ensures the walk is very short if
* there is good bitmap coverage .
* /
private static class AddToBitmapFilter extends RevFilter {
static class AddToBitmapFilter extends RevFilter {
private final BitmapBuilder bitmap ;
AddToBitmapFilter ( BitmapBuilder bitmap ) {
@ -209,7 +206,7 @@ final class PackWriterBitmapWalker {
* encountered , that commit and its parents will be marked with the SEEN
* flag to prevent the walk from visiting its ancestors .
* /
private static class AddUnseenToBitmapFilter extends RevFilter {
static class AddUnseenToBitmapFilter extends RevFilter {
private final BitmapBuilder seen ;
private final BitmapBuilder bitmap ;