diff options
Diffstat (limited to 'buildstream/_loader/loadelement.py')
-rw-r--r-- | buildstream/_loader/loadelement.py | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/buildstream/_loader/loadelement.py b/buildstream/_loader/loadelement.py index 465d97f2c..7dd4237fa 100644 --- a/buildstream/_loader/loadelement.py +++ b/buildstream/_loader/loadelement.py @@ -19,9 +19,6 @@ # System imports from collections.abc import Mapping -from itertools import count - -from roaringbitmap import RoaringBitmap, ImmutableRoaringBitmap # pylint: disable=no-name-in-module # BuildStream toplevel imports from .._exceptions import LoadError, LoadErrorReason @@ -57,8 +54,6 @@ class LoadElement(): self.element = element self.dep_type = dep_type - _counter = count() - def __init__(self, node, filename, loader): # @@ -68,7 +63,6 @@ class LoadElement(): self.name = filename # The element name self.full_name = None # The element full name (with associated junction) self.deps = None # The list of Dependency objects - self.node_id = next(self._counter) # # Private members @@ -113,7 +107,7 @@ class LoadElement(): # def depends(self, other): self._ensure_depends_cache() - return other.node_id in self._dep_cache + return self._dep_cache.get(other.full_name) is not None ########################################### # Private Methods # @@ -123,8 +117,7 @@ class LoadElement(): if self._dep_cache: return - self._dep_cache = RoaringBitmap() - + self._dep_cache = {} for dep in self.dependencies: elt = dep.element @@ -132,13 +125,11 @@ class LoadElement(): elt._ensure_depends_cache() # We depend on this element - self._dep_cache.add(elt.node_id) + self._dep_cache[elt.full_name] = True # And we depend on everything this element depends on self._dep_cache.update(elt._dep_cache) - self._dep_cache = ImmutableRoaringBitmap(self._dep_cache) - # _extract_depends_from_node(): # |