commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1135962 - /commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/Dijkstra.java
Date Wed, 15 Jun 2011 08:51:50 GMT
Author: simonetripodi
Date: Wed Jun 15 08:51:49 2011
New Revision: 1135962

URL: http://svn.apache.org/viewvc?rev=1135962&view=rev
Log:
used proper Double wrapper comparator method for comparing values

Modified:
    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/Dijkstra.java

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/Dijkstra.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/Dijkstra.java?rev=1135962&r1=1135961&r2=1135962&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/Dijkstra.java
(original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/Dijkstra.java
Wed Jun 15 08:51:49 2011
@@ -107,7 +107,7 @@ public final class Dijkstra
                 {
                     Double shortDist = shortestDistances.get( vertex ) + edge.getWeight();
 
-                    if ( shortDist < shortestDistances.get( v ) )
+                    if ( shortDist.compareTo( shortestDistances.get( v ) ) < 0 )
                     {
                         // assign new shortest distance and mark unsettled
                         shortestDistances.put( v, shortDist );



Mime
View raw message