From 3af5a89bdefc20ffdc4b66a5ae2a62a8cbabe36c Mon Sep 17 00:00:00 2001 From: Stefan Hansson Date: Wed, 16 Dec 2020 09:26:50 +0100 Subject: More redundant changes removed --- algorithms.py | 3 +-- store.py | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/algorithms.py b/algorithms.py index f8d2e50..9f3fd78 100644 --- a/algorithms.py +++ b/algorithms.py @@ -77,7 +77,7 @@ def get_closest_node(nodes, source_node): for node in nodes: length = length_haversine(source_node, node) - if (min_node is None or length < min_value): + if min_node is None or length < min_value: min_node = node min_value = length @@ -114,6 +114,5 @@ def find_shortest_path(nodes, source_id, target_id): new_dist = walk_dist + length_haversine(nodes[walk_end], neighbour) new_walk = walk + (neighbour.id,) heapq.heappush(queue, (new_dist, new_walk)) - # no path found return None diff --git a/store.py b/store.py index 34c0f0b..2930e19 100644 --- a/store.py +++ b/store.py @@ -128,7 +128,6 @@ def make_forest(nodes): # becomes the root of each node since it will be the same for all nodes # in the same tree due our use of union-find. forest = defaultdict(dict) - for node_id, node in nodes.items(): forest[node.find_root().id][node_id] = node -- cgit v1.2.1