Benjamin Schubert pushed to branch bschubert/further-opti at BuildStream / buildstream
Commits:
-
34a34432
by Benjamin Schubert at 2019-02-05T18:11:09Z
1 changed file:
Changes:
... | ... | @@ -294,9 +294,9 @@ class Loader(): |
294 | 294 |
def _check_circular_deps(self, element, check_elements=None, validated=None, sequence=None):
|
295 | 295 |
|
296 | 296 |
if check_elements is None:
|
297 |
- check_elements = {}
|
|
297 |
+ check_elements = set()
|
|
298 | 298 |
if validated is None:
|
299 |
- validated = {}
|
|
299 |
+ validated = set()
|
|
300 | 300 |
if sequence is None:
|
301 | 301 |
sequence = []
|
302 | 302 |
|
... | ... | @@ -316,7 +316,7 @@ class Loader(): |
316 | 316 |
.format(element.full_name, " -> ".join(chain)))
|
317 | 317 |
|
318 | 318 |
# Push / Check each dependency / Pop
|
319 |
- check_elements[element] = True
|
|
319 |
+ check_elements.add(element)
|
|
320 | 320 |
sequence.append(element.full_name)
|
321 | 321 |
for dep in element.dependencies:
|
322 | 322 |
dep.element._loader._check_circular_deps(dep.element, check_elements, validated, sequence)
|
... | ... | @@ -324,7 +324,7 @@ class Loader(): |
324 | 324 |
sequence.pop()
|
325 | 325 |
|
326 | 326 |
# Eliminate duplicate paths
|
327 |
- validated[element] = True
|
|
327 |
+ validated.add(element)
|
|
328 | 328 |
|
329 | 329 |
# _sort_dependencies():
|
330 | 330 |
#
|