You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by si...@apache.org on 2011/06/15 10:51:50 UTC
svn commit: r1135962 -
/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/Dijkstra.java
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 );