From 94e6db54b8c8411cead8cc4186aa9199a23d617e Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Wed, 20 Jun 2018 09:42:18 +0200 Subject: Simplify MenuNode.referenced() a bit Can get the initial set from expr_items(self.dep), since it's always included and always returns a new set(). --- kconfiglib.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/kconfiglib.py b/kconfiglib.py index 3101c65..d62c7a8 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -4206,7 +4206,9 @@ class MenuNode(object): Also includes dependencies inherited from surrounding menus and if's. Choices appear in the dependencies of choice symbols. """ - res = set() + # self.dep is included to catch dependencies from a lone 'depends on' + # when there are no properties to propagate it to + res = expr_items(self.dep) if self.prompt: res |= expr_items(self.prompt[1]) @@ -4231,10 +4233,6 @@ class MenuNode(object): res.add(high) res |= expr_items(cond) - # Need this to catch dependencies from a lone 'depends on' when there - # are no properties to propagate it to - res |= expr_items(self.dep) - return res def __repr__(self): -- cgit v1.2.3