Author: j16sdiz
Date: 2009-04-18 13:59:19 +0000 (Sat, 18 Apr 2009)
New Revision: 26966

Modified:
   trunk/freenet/src/freenet/node/FailureTableEntry.java
Log:
refactor cleanup() into cleanupRequestor() and cleanupRequested()

Modified: trunk/freenet/src/freenet/node/FailureTableEntry.java
===================================================================
--- trunk/freenet/src/freenet/node/FailureTableEntry.java       2009-04-18 
13:58:48 UTC (rev 26965)
+++ trunk/freenet/src/freenet/node/FailureTableEntry.java       2009-04-18 
13:59:19 UTC (rev 26966)
@@ -442,11 +442,16 @@
                }
                return -1; // not timed out
        }
+       
+       public synchronized boolean cleanup() {
+               long now = System.currentTimeMillis(); // don't pass in as a 
pass over the whole FT may take a while. get it in the method.
+               
+               return cleanupRequestor(now) && cleanupRequested(now);
+       }
 
-       public synchronized boolean cleanup() {
+       private boolean cleanupRequestor(long now) {
                boolean empty = true;
                int x = 0;
-               long now = System.currentTimeMillis(); // don't pass in as a 
pass over the whole FT may take a while. get it in the method.
                for(int i=0;i<requestorNodes.length;i++) {
                        WeakReference<PeerNode> ref = requestorNodes[i];
                        if(ref == null) continue;
@@ -474,7 +479,13 @@
                        requestorTimes = newRequestorTimes;
                        requestorBootIDs = newRequestorBootIDs;
                }
-               x = 0;
+               
+               return empty;
+       }
+       
+       private boolean cleanupRequested(long now) {
+               boolean empty = true;
+               int x = 0;
                for(int i=0;i<requestedNodes.length;i++) {
                        WeakReference<PeerNode> ref = requestedNodes[i];
                        if(ref == null) continue;

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

Reply via email to