Update OneAtATimeIterator.py

saving node_list after sorting
This commit is contained in:
Saumya Jain 2024-02-09 11:20:04 +01:00 committed by GitHub
parent 355f24e29f
commit a7292c7baf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -68,7 +68,7 @@ class OneAtATimeIterator(Iterator.Iterator):
# Sort the original list so that items that block the most other objects are at the beginning.
# This does not decrease the worst case running time, but should improve it in most cases.
sorted(node_list, key = cmp_to_key(hit_checker.calculateScore))
node_list = sorted(node_list, key = cmp_to_key(hit_checker.calculateScore))
todo_node_list = [_ObjectOrder([], node_list)]
while len(todo_node_list) > 0: