[freenet-cvs] r13494 - trunk/freenet/src/freenet/node

toad at freenetproject.org toad at freenetproject.org
Fri Jun 8 18:08:15 UTC 2007


Author: toad
Date: 2007-06-08 18:08:15 +0000 (Fri, 08 Jun 2007)
New Revision: 13494

Modified:
   trunk/freenet/src/freenet/node/PeerManager.java
Log:
loc -> target

Modified: trunk/freenet/src/freenet/node/PeerManager.java
===================================================================
--- trunk/freenet/src/freenet/node/PeerManager.java	2007-06-08 18:07:35 UTC (rev 13493)
+++ trunk/freenet/src/freenet/node/PeerManager.java	2007-06-08 18:08:15 UTC (rev 13494)
@@ -568,7 +568,7 @@
 	 * @param addUnpickedLocsTo Add all locations we didn't choose which we could have routed to to 
 	 * this array. Remove the location of the peer we pick from it.
      */
-    private PeerNode _closerPeer(PeerNode pn, HashSet routedTo, HashSet notIgnored, double loc, boolean ignoreSelf, boolean ignoreBackedOff, int minVersion, Vector addUnpickedLocsTo) {
+    private PeerNode _closerPeer(PeerNode pn, HashSet routedTo, HashSet notIgnored, double target, boolean ignoreSelf, boolean ignoreBackedOff, int minVersion, Vector addUnpickedLocsTo) {
         PeerNode[] peers;  
         synchronized (this) {
 			peers = connectedPeers;
@@ -577,7 +577,7 @@
         double bestDiff = Double.MAX_VALUE;
         double maxDiff = 0.0;
         if(!ignoreSelf)
-            maxDiff = distance(node.lm.getLocation().getValue(), loc);
+            maxDiff = distance(node.lm.getLocation().getValue(), target);
         PeerNode best = null;
         double bestLoc = -2;
         int count = 0;
@@ -604,8 +604,8 @@
             	continue;
             }
             count++;
-            double diff = distance(p, loc);
-            if(logMINOR) Logger.minor(this, "p.loc="+p.getLocation().getValue()+", loc="+loc+", d="+distance(p.getLocation().getValue(), loc)+" usedD="+diff+" for "+p.getPeer());
+            double diff = distance(p, target);
+            if(logMINOR) Logger.minor(this, "p.loc="+p.getLocation().getValue()+", target="+target+", d="+distance(p.getLocation().getValue(), target)+" usedD="+diff+" for "+p.getPeer());
             if((!ignoreSelf) && (diff > maxDiff)) {
             	if(logMINOR) Logger.minor(this, "Ignoring because >maxDiff="+maxDiff);
             	continue;
@@ -618,7 +618,7 @@
             		if(!addUnpickedLocsTo.contains(d))
             			addUnpickedLocsTo.add(d);
             	}
-            	bestLoc = loc;
+            	bestLoc = target;
                 best = p;
                 bestDiff = diff;
                 if(logMINOR) Logger.minor(this, "New best: "+diff+" ("+p.getLocation().getValue()+" for "+p.getPeer());




More information about the cvs mailing list