From ec0da1defabfd84c0aaf4a863de1a6a41f202076 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Mon, 29 Jul 2024 23:03:47 -0400 Subject: mypy: reduce layers of indirection to ensure narrower type inference We have a function that wraps two others because it first checks whether the input is static or shared. By the same token, it has to return types valid for either. We already *know* that we are a shared library, so we can and should use the real function directly, which is both a micro-optimization of function call overhead, and fixes a mypy "union-attr" error. --- mesonbuild/backend/ninjabackend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index b43b8bbe4..783cd78b5 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -3712,7 +3712,7 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485''')) #Add archive file if shared library in AIX for build all. if isinstance(t, build.SharedLibrary) and t.aix_so_archive: if self.environment.machines[t.for_machine].is_aix(): - linker, stdlib_args = self.determine_linker_and_stdlib_args(t) + linker, stdlib_args = t.get_clink_dynamic_linker_and_stdlibs() t.get_outputs()[0] = linker.get_archive_name(t.get_outputs()[0]) targetlist.append(os.path.join(self.get_target_dir(t), t.get_outputs()[0])) -- cgit v1.2.3