Skip to content

Commit 4a622cf

Browse files
dcbakereli-schwartz
authored andcommitted
coredata: remove use of stringlistify to do a cast
This is a heavyweight and expensive function to use to verify that we have a string list. Just cast to make mypy happy, we know what we have. (cherry picked from commit cec99fb)
1 parent 2ad03a0 commit 4a622cf

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

mesonbuild/coredata.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
MesonException, MachineChoice, PerMachine,
1919
PerMachineDefaultable,
2020
default_prefix,
21-
stringlistify,
2221
pickle_load
2322
)
2423

@@ -152,8 +151,8 @@ def __init__(self, builtins: options.OptionStore, for_machine: MachineChoice):
152151

153152
def __calculate_subkey(self, type_: DependencyCacheType) -> T.Tuple[str, ...]:
154153
data: T.Dict[DependencyCacheType, T.List[str]] = {
155-
DependencyCacheType.PKG_CONFIG: stringlistify(self.__builtins.get_value_for(self.__pkg_conf_key)),
156-
DependencyCacheType.CMAKE: stringlistify(self.__builtins.get_value_for(self.__cmake_key)),
154+
DependencyCacheType.PKG_CONFIG: T.cast('T.List[str]', self.__builtins.get_value_for(self.__pkg_conf_key)),
155+
DependencyCacheType.CMAKE: T.cast('T.List[str]', self.__builtins.get_value_for(self.__cmake_key)),
157156
DependencyCacheType.OTHER: [],
158157
}
159158
assert type_ in data, 'Someone forgot to update subkey calculations for a new type'

0 commit comments

Comments
 (0)