r26931 - trunk/freenet/src/freenet/client/async

[email protected] Fri, 17 Apr 2009 11:44:19 +0000
Newsgroups gmane.network.freenet.cvs
Message-ID <[email protected]>
Author: j16sdiz
Date: 2009-04-17 11:44:18 +0000 (Fri, 17 Apr 2009)
New Revision: 26931

Modified:
   trunk/freenet/src/freenet/client/async/InsertCompressor.java
Log:
Lessor BucketFactory construction

Modified: trunk/freenet/src/freenet/client/async/InsertCompressor.java
===================================================================
--- trunk/freenet/src/freenet/client/async/InsertCompressor.java	2009-04-17 11:43:53 UTC (rev 26930)
+++ trunk/freenet/src/freenet/client/async/InsertCompressor.java	2009-04-17 11:44:18 UTC (rev 26931)
@@ -96,6 +96,8 @@
 		// Try each algorithm, starting with the fastest and weakest.
 		// Stop when run out of algorithms, or the compressed data fits in a single block.
 		try {
+			BucketChainBucketFactory bucketFactory2 = new BucketChainBucketFactory(bucketFactory, NodeCHK.BLOCK_SIZE, persistent ? context.jobRunner : null, 1024);
+			
 			for(final COMPRESSOR_TYPE comp : COMPRESSOR_TYPE.values()) {
 				boolean shouldFreeOnFinally = true;
 				Bucket result = null;
@@ -127,8 +129,8 @@
 						Logger.error(this, "Transient insert callback threw "+t, t);
 					}
 				}
-				
-				result = comp.compress(origData, new BucketChainBucketFactory(bucketFactory, NodeCHK.BLOCK_SIZE, persistent ? context.jobRunner : null, 1024), origSize, bestCompressedDataSize);
+
+				result = comp.compress(origData, bucketFactory2, origSize, bestCompressedDataSize);
 				long resultSize = result.size();
 				if(resultSize < minSize) {
 					bestCodec = comp;