scripts/depscan: remove unnecessary function

This basically existed for an assert which we don't need, as mypy would
catch that issue for us anyway. Removing the function entirely has some
small performance advantages
pull/13021/head
Dylan Baker 12 months ago
parent 433117fc5a
commit 3e9021a4c4
  1. 7
      mesonbuild/scripts/depscan.py

@ -107,11 +107,6 @@ class DependencyScanner:
self.provided_by[exported_module] = fname
self.exports[fname] = exported_module
def objname_for(self, src: str) -> str:
objname = self.target_data.source2object[src]
assert isinstance(objname, str)
return objname
def module_name_for(self, src: str, lang: Literal['cpp', 'fortran']) -> str:
if lang == 'fortran':
exported = self.exports[src]
@ -131,7 +126,7 @@ class DependencyScanner:
with open(self.outfile, 'w', encoding='utf-8') as ofile:
ofile.write('ninja_dyndep_version = 1\n')
for src, lang in self.sources:
objfilename = self.objname_for(src)
objfilename = self.target_data.source2object[src]
mods_and_submods_needed = []
module_files_generated = []
module_files_needed = []

Loading…
Cancel
Save