Author: zothar
Date: 2006-12-10 00:44:10 +0000 (Sun, 10 Dec 2006)
New Revision: 11330

Modified:
   trunk/freenet/src/freenet/node/LocationManager.java
Log:
Clarify LocationManager.updateLocationChangeSession() code with variable names. 
 Mildly refactor same.

Modified: trunk/freenet/src/freenet/node/LocationManager.java
===================================================================
--- trunk/freenet/src/freenet/node/LocationManager.java 2006-12-09 21:42:05 UTC 
(rev 11329)
+++ trunk/freenet/src/freenet/node/LocationManager.java 2006-12-10 00:44:10 UTC 
(rev 11330)
@@ -84,11 +84,12 @@
         this.loc = l;
     }

-    public void updateLocationChangeSession(double l) {
-               if (l < this.loc.getValue()) {
-                       this.locChangeSession -= (this.loc.getValue() - l);
+    public void updateLocationChangeSession(double newLoc) {
+       double oldLoc = this.loc.getValue();
+               if (newLoc < oldLoc) {
+                       this.locChangeSession -= (oldLoc - newLoc);
                } else {
-                       this.locChangeSession += (l - this.loc.getValue());
+                       this.locChangeSession += (newLoc - oldLoc);
                }
     }



Reply via email to