From e3b844ecf5aea7c2e3256f78632f23fff570c9ad Mon Sep 17 00:00:00 2001 From: DKE Date: Sun, 23 Sep 2018 17:25:13 +0200 Subject: [PATCH] Change PriorityQueue expansion `self.heap.append` simply appends to the end of the `self.heap` Since `self.heap` is just a python list. `self.append` calls the append method of the class instance, effectively putting the item in its proper place. --- utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils.py b/utils.py index 5d91c88ef..a514a67eb 100644 --- a/utils.py +++ b/utils.py @@ -717,7 +717,7 @@ def append(self, item): def extend(self, items): """Insert each item in items at its correct position.""" for item in items: - self.heap.append(item) + self.append(item) def pop(self): """Pop and return the item (with min or max f(x) value