Commit 42d3106
committed
Fix direct routes
There's a bug in the code for direct routes that are not over multiple hops.
min-route expects a collection so we should always return a collection.
This way it works for both direct and indirect routes:
(find-path (grouped-routes routes) :paris :london)
;; => {:cost 236, :best [:paris :london]}
(find-path (grouped-routes routes) :paris :budapest)
;; => {:cost 251, :best [:paris :milan :vienna :budapest]}1 parent a1502fb commit 42d3106
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
0 commit comments