Use a safer compare().
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2575 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -131,7 +131,7 @@ public class ShortestPath
|
|||||||
|
|
||||||
/** We order ourselves by the cumulative weight to this node. */
|
/** We order ourselves by the cumulative weight to this node. */
|
||||||
public int compareTo (NodeInfo<T, V> o) {
|
public int compareTo (NodeInfo<T, V> o) {
|
||||||
return o.weightTo - weightTo;
|
return Comparators.compare(o.weightTo, weightTo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user