Factor out more option iterating
This commit is contained in:
parent
f9a35e08ac
commit
9b13fb3672
|
@ -483,8 +483,13 @@ class CoreData:
|
||||||
yield self.compiler_options
|
yield self.compiler_options
|
||||||
yield self.base_options
|
yield self.base_options
|
||||||
|
|
||||||
|
def get_all_options(self):
|
||||||
|
return chain(
|
||||||
|
iter([self.builtins]),
|
||||||
|
self._get_all_nonbuiltin_options())
|
||||||
|
|
||||||
def validate_option_value(self, option_name, override_value):
|
def validate_option_value(self, option_name, override_value):
|
||||||
for opts in chain(iter([self.builtins]), self._get_all_nonbuiltin_options()):
|
for opts in self.get_all_options():
|
||||||
if option_name in opts:
|
if option_name in opts:
|
||||||
opt = opts[option_name]
|
opt = opts[option_name]
|
||||||
return opt.validate_value(override_value)
|
return opt.validate_value(override_value)
|
||||||
|
|
|
@ -1957,10 +1957,7 @@ class Interpreter(InterpreterBase):
|
||||||
def get_non_matching_default_options(self):
|
def get_non_matching_default_options(self):
|
||||||
env = self.environment
|
env = self.environment
|
||||||
for def_opt_name, def_opt_value in self.project_default_options.items():
|
for def_opt_name, def_opt_value in self.project_default_options.items():
|
||||||
for option_type in [
|
for option_type in env.coredata.get_all_options():
|
||||||
env.coredata.builtins, env.coredata.compiler_options,
|
|
||||||
env.coredata.backend_options, env.coredata.base_options,
|
|
||||||
env.coredata.user_options]:
|
|
||||||
for cur_opt_name, cur_opt_value in option_type.items():
|
for cur_opt_name, cur_opt_value in option_type.items():
|
||||||
if (def_opt_name == cur_opt_name and
|
if (def_opt_name == cur_opt_name and
|
||||||
def_opt_value != cur_opt_value.value):
|
def_opt_value != cur_opt_value.value):
|
||||||
|
|
Loading…
Reference in New Issue