소스 검색

Less magic numbers

Piotr Czajkowski 2 년 전
부모
커밋
beb584bc0e
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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) {