From: Alexander Popov Date: Thu, 5 Mar 2020 09:07:33 +0000 (+0300) Subject: Simplify perform_checks() X-Git-Tag: v0.5.5~38 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=5a2b22d70d1bf3610fb5ab94e63ee774f3a23421;p=kconfig-hardened-check.git Simplify perform_checks() --- diff --git a/kconfig-hardened-check.py b/kconfig-hardened-check.py index 56c52ec..0975ba0 100755 --- a/kconfig-hardened-check.py +++ b/kconfig-hardened-check.py @@ -417,17 +417,15 @@ def print_checklist(checklist, with_results): print() -def get_option_state(options, name): - return options.get(name, None) - - def perform_checks(checklist, parsed_options): for opt in checklist: if hasattr(opt, 'opts'): + # prepare ComplexOptCheck for o in opt.opts: - o.state = get_option_state(parsed_options, o.name) + o.state = parsed_options.get(o.name, None) else: - opt.state = get_option_state(parsed_options, opt.name) + # prepare OptCheck + opt.state = parsed_options.get(opt.name, None) opt.check()