Author: toad
Date: 2008-11-22 18:37:32 +0000 (Sat, 22 Nov 2008)
New Revision: 23808

Modified:
   trunk/freenet/src/freenet/client/FECCodec.java
Log:
Shortcut


Modified: trunk/freenet/src/freenet/client/FECCodec.java
===================================================================
--- trunk/freenet/src/freenet/client/FECCodec.java      2008-11-22 18:36:47 UTC 
(rev 23807)
+++ trunk/freenet/src/freenet/client/FECCodec.java      2008-11-22 18:37:32 UTC 
(rev 23808)
@@ -119,6 +119,18 @@
                                packets[i] = new Buffer(realBuffer, i * 
STRIPE_SIZE,
                                        STRIPE_SIZE);
 
+                       // Shortcut.
+                       // Due to the not-fetching-last-block code, we need to 
check here,
+                       // rather than relying on numberToDecode (since the 
last data block won't be part of numberToDecode).
+                       
+                       boolean needDecode = false;
+                       for(int i = 0; i < dataBlockStatus.length;i++) {
+                               if(dataBlockStatus[i].getData() == null)
+                                       needDecode = true;
+                       }
+                       
+                       if(!needDecode) return;
+                       
                        for(int i = 0; i < dataBlockStatus.length; i++) {
                                buckets[i] = dataBlockStatus[i].getData();
                                if(buckets[i] == null) {

_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to