Explorar o código

Less magic numbers

Piotr Czajkowski %!s(int64=2) %!d(string=hai) anos
pai
achega
beb584bc0e
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      16/code.go

+ 1 - 1
16/code.go

@@ -144,7 +144,7 @@ func traverse(from vertex, vertices []vertex, graph []path) []vertex {
 			if current.cost == maxValue {
 				tentativeCost = maxValue
 			} else {
-				tentativeCost = current.cost + 1
+				tentativeCost = current.cost + graph[j].cost
 			}
 
 			if tentativeCost < getCost(graph[j].to, newVertices) {