From d2dc38abd45bf7427ef27043847cf9c89513bd1e Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Fri, 2 Jun 2017 05:23:47 +0530 Subject: [PATCH] ninja: Use a set for target deps and ordered deps This significantly reduces the size of build.ninja for GStreamer. --- mesonbuild/backend/ninjabackend.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 6bd963319..a794ba81d 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -58,22 +58,22 @@ class NinjaBuildElement: self.infilenames = [infilenames] else: self.infilenames = infilenames - self.deps = [] - self.orderdeps = [] + self.deps = set() + self.orderdeps = set() self.elems = [] self.all_outputs = all_outputs def add_dep(self, dep): if isinstance(dep, list): - self.deps += dep + self.deps.update(dep) else: - self.deps.append(dep) + self.deps.add(dep) def add_orderdep(self, dep): if isinstance(dep, list): - self.orderdeps += dep + self.orderdeps.update(dep) else: - self.orderdeps.append(dep) + self.orderdeps.add(dep) def add_item(self, name, elems): if isinstance(elems, str):