Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eee83f6

Browse files
D-K-Enorvig
authored andcommitted
Change PriorityQueue expansion (aimacode#962)
`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.
1 parent 62f7d67 commit eee83f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ def append(self, item):
717717
def extend(self, items):
718718
"""Insert each item in items at its correct position."""
719719
for item in items:
720-
self.heap.append(item)
720+
self.append(item)
721721

722722
def pop(self):
723723
"""Pop and return the item (with min or max f(x) value

0 commit comments

Comments
 (0)