Benjamin Schubert pushed to branch bschubert/rework-sort at BuildStream / buildstream
Commits:
-
e7a14430
by Benjamin Schubert at 2019-02-04T16:14:05Z
1 changed file:
Changes:
... | ... | @@ -441,6 +441,8 @@ class Loader(): |
441 | 441 |
meta_element = element._loader._collect_element(element)
|
442 | 442 |
element.visit(meta_element)
|
443 | 443 |
|
444 |
+ visited_elements = []
|
|
445 |
+ |
|
444 | 446 |
for dep in sorted(element.dependencies, key=cmp_to_key(compare_unprocessed), reverse=True):
|
445 | 447 |
if dep.dep_type != Symbol.RUNTIME:
|
446 | 448 |
dep.element.on_visit(meta_element.build_dependencies.append)
|
... | ... | @@ -452,7 +454,9 @@ class Loader(): |
452 | 454 |
# it as soon as possible
|
453 | 455 |
elements_to_load.append(dep.element)
|
454 | 456 |
else:
|
455 |
- elements_to_load.appendleft(dep.element)
|
|
457 |
+ visited_elements.append(dep.element)
|
|
458 |
+ |
|
459 |
+ elements_to_load.extendleft(visited_elements)
|
|
456 | 460 |
|
457 | 461 |
for element in self._meta_elements.values():
|
458 | 462 |
element.build_dependencies.sort(key=attrgetter("index"), reverse=True)
|