Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(412)

Unified Diff: pylib/gyp/input.py

Issue 235193002: gyp: use a set() in DeepDependencies for less O(n^2). (Closed) Base URL: https://chromium.googlesource.com/external/gyp.git@master
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pylib/gyp/input.py
diff --git a/pylib/gyp/input.py b/pylib/gyp/input.py
index f694e57b9fe455197bcd5eb423c48b66a8f0376e..6ce5ba250d4f4f2d0cbaf2f6b2423820a4535ad3 100644
--- a/pylib/gyp/input.py
+++ b/pylib/gyp/input.py
@@ -1602,12 +1602,12 @@ class DependencyGraphNode(object):
def DeepDependencies(self, dependencies=None):
"""Returns a list of all of a target's dependencies, recursively."""
if dependencies == None:
- dependencies = []
+ dependencies = set()
for dependency in self.dependencies:
# Check for None, corresponding to the root node.
if dependency.ref != None and dependency.ref not in dependencies:
- dependencies.append(dependency.ref)
+ dependencies.add(dependency.ref)
dependency.DeepDependencies(dependencies)
return dependencies
Nico 2014/04/11 16:11:01 DeepDependencies() now won't return results in det
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698