# HG changeset patch # User Franz Glasner # Date 1639781618 -3600 # Node ID 8e516f17cf951dd035d9827c17f06bb2b225d657 # Parent 36ab39e3de537f65e1bc39d0fc0710cc3f765a68 Optimize .substitute_variables_in_obj: use dict.items() to avoid one dict lookup diff -r 36ab39e3de53 -r 8e516f17cf95 configmix/config.py --- a/configmix/config.py Fri Dec 17 23:53:11 2021 +0100 +++ b/configmix/config.py Fri Dec 17 23:53:38 2021 +0100 @@ -638,8 +638,8 @@ return self.expand_variable(obj) elif issubclass(ty, dict): newdict = ty() - for k in obj: - newdict[k] = self.substitute_variables_in_obj(obj[k]) + for k, v in obj.items(): + newdict[k] = self.substitute_variables_in_obj(v) return newdict elif issubclass(ty, list): return [self.substitute_variables_in_obj(i) for i in obj]