From 52f44525548b3bf4a188ec5547efc471a1c3c947 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Kl=C3=B6tzke?= Date: Fri, 12 Jul 2024 22:45:18 +0200 Subject: [PATCH] input: eliminate some unnecessary env copies --- pym/bob/input.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pym/bob/input.py b/pym/bob/input.py index 1434efbb..255f469c 100644 --- a/pym/bob/input.py +++ b/pym/bob/input.py @@ -2259,8 +2259,8 @@ def prepare(self, inputEnv, sandboxEnabled, inputStates, inputSandbox=None, "__tools" : tools }) env = inputEnv.derive() for i in self.__varSelf: - env = env.derive({ key : env.substitute(value, "environment::"+key) - for key, value in i.items() }) + env.update(( (key, env.substitute(value, "environment::"+key)) + for key, value in i.items() )) states = { n : s.copy() for (n,s) in inputStates.items() } # update plugin states @@ -2327,9 +2327,10 @@ def prepare(self, inputEnv, sandboxEnabled, inputStates, inputSandbox=None, k : depDiffTools.get(v, v) for k, v in dep.toolOverride.items() }) - thisDepEnv = thisDepEnv.derive( - { key : env.substitute(value, "depends["+recipe+"].environment["+key+"]") - for key, value in dep.envOverride.items() }) + if dep.envOverride: + thisDepEnv = thisDepEnv.derive( + { key : env.substitute(value, "depends["+recipe+"].environment["+key+"]") + for key, value in dep.envOverride.items() }) r = self.__recipeSet.getRecipe(recipe) try: