Bug 875023 - Make Rule._executeweak faster in e.g. dom/bindings. r=ted

This commit is contained in:
Mike Hommey 2013-05-23 07:27:50 +02:00
Родитель 3b4751bb8b
Коммит 3cad13118b
1 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -167,9 +167,13 @@ class Rule(Statement):
This lets us go really fast and is generally good.
"""
assert context.weak
assert len(self.targetexp.resolvesplit(makefile, makefile.variables)) == 1
target = self.targetexp.resolvesplit(makefile, makefile.variables)[0]
deps = self.depexp.resolvesplit(makefile, makefile.variables)
# Skip targets with no rules and no dependencies
if not deps:
return
targets = self.targetexp.resolvesplit(makefile, makefile.variables)
assert len(targets) == 1
target = targets[0]
rule = data.Rule(deps, self.doublecolon, loc=self.targetexp.loc, weakdeps=True)
makefile.gettarget(target).addrule(rule)
makefile.foundtarget(target)