@ -62,11 +62,8 @@ final class DeltaWindow {
private static final int NEXT_SRC = 1 ;
private static final int NEXT_SRC = 1 ;
private final PackConfig config ;
private final PackConfig config ;
private final DeltaCache deltaCache ;
private final DeltaCache deltaCache ;
private final ObjectReader reader ;
private final ObjectReader reader ;
private final ProgressMonitor monitor ;
private final ProgressMonitor monitor ;
private final DeltaWindowEntry [ ] window ;
private final DeltaWindowEntry [ ] window ;
@ -136,7 +133,7 @@ final class DeltaWindow {
for ( int i = 0 ; i < window . length ; i + + )
for ( int i = 0 ; i < window . length ; i + + )
window [ i ] = new DeltaWindowEntry ( ) ;
window [ i ] = new DeltaWindowEntry ( ) ;
maxMemory = config . getDeltaSearchMemoryLimit ( ) ;
maxMemory = Math . max ( 0 , config . getDeltaSearchMemoryLimit ( ) ) ;
maxDepth = config . getMaxDeltaDepth ( ) ;
maxDepth = config . getMaxDeltaDepth ( ) ;
}
}
@ -172,7 +169,7 @@ final class DeltaWindow {
next = toSearch [ cur + + ] ;
next = toSearch [ cur + + ] ;
}
}
res = window [ resSlot ] ;
res = window [ resSlot ] ;
if ( 0 < maxMemory ) {
if ( maxMemory ! = 0 ) {
clear ( res ) ;
clear ( res ) ;
int tail = next ( resSlot ) ;
int tail = next ( resSlot ) ;
final long need = estimateSize ( next ) ;
final long need = estimateSize ( next ) ;
@ -480,7 +477,7 @@ final class DeltaWindow {
e . setObjectId ( ent . object ) ;
e . setObjectId ( ent . object ) ;
throw e ;
throw e ;
}
}
if ( 0 < maxMemory )
if ( maxMemory ! = 0 )
loaded + = idx . getIndexSize ( ) - idx . getSourceSize ( ) ;
loaded + = idx . getIndexSize ( ) - idx . getSourceSize ( ) ;
ent . index = idx ;
ent . index = idx ;
}
}
@ -494,7 +491,7 @@ final class DeltaWindow {
checkLoadable ( ent , ent . size ( ) ) ;
checkLoadable ( ent , ent . size ( ) ) ;
buf = PackWriter . buffer ( config , reader , ent . object ) ;
buf = PackWriter . buffer ( config , reader , ent . object ) ;
if ( 0 < maxMemory )
if ( maxMemory ! = 0 )
loaded + = buf . length ;
loaded + = buf . length ;
ent . buffer = buf ;
ent . buffer = buf ;
}
}
@ -502,7 +499,7 @@ final class DeltaWindow {
}
}
private void checkLoadable ( DeltaWindowEntry ent , long need ) {
private void checkLoadable ( DeltaWindowEntry ent , long need ) {
if ( maxMemory < = 0 )
if ( maxMemory = = 0 )
return ;
return ;
int tail = next ( resSlot ) ;
int tail = next ( resSlot ) ;