Skip to content

Commit fc76e32

Browse files
committed
SCrutinizer fixes
1 parent 0fb4fa5 commit fc76e32

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/MultiDijkstra.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static function findShortestPaths(Vertex $startVertex, Vertex $endVertex)
3636
$predecesEdgeOfCheapestPathTo = [];
3737

3838
// mark vertices when their cheapest path has been found
39-
$usedVertices[$startVertex->getId()] = true;
39+
$usedVertices = [ $startVertex->getId() => true ];
4040

4141
$isFirst = true;
4242

@@ -102,9 +102,6 @@ public static function findShortestPaths(Vertex $startVertex, Vertex $endVertex)
102102
if (!isset($usedVertices[$targetVertexId])) {
103103
// calculate new cost to vertex
104104
$newCostsToTargetVertex = $totalCostOfCheapestPathTo[$currentVertexId] + $weight;
105-
/*if (is_infinite($newCostsToTargetVertex)) {
106-
$newCostsToTargetVertex = $weight;
107-
}*/
108105

109106
if ((!isset($predecesEdgeOfCheapestPathTo[$targetVertexId]))
110107
// is the new path cheaper?

0 commit comments

Comments
 (0)