diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2021-02-23 11:26:19 -0800 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2021-02-23 16:22:56 -0800 |
commit | 0edd0058046069f715d753dddee6e6c08e79207d (patch) | |
tree | 6adee717078a24426c49064c1b1ac2f95923ed49 /mesonbuild/backend/ninjabackend.py | |
parent | 6544f151db7a04993ff75540ed6a0cb2a4573b02 (diff) | |
download | meson-0edd0058046069f715d753dddee6e6c08e79207d.zip meson-0edd0058046069f715d753dddee6e6c08e79207d.tar.gz meson-0edd0058046069f715d753dddee6e6c08e79207d.tar.bz2 |
rust: replace for loop with any()
This is a little cleaner, and short circuits correctly, unlike the loop
it replaces
Diffstat (limited to 'mesonbuild/backend/ninjabackend.py')
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index a0a34b3..b7723ef 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -1630,10 +1630,7 @@ int dummy; if d == '': d = '.' args += ['-L', d] - has_shared_deps = False - for dep in target.get_dependencies(): - if isinstance(dep, build.SharedLibrary): - has_shared_deps = True + has_shared_deps = any(isinstance(dep, build.SharedLibrary) for dep in target.get_dependencies()) if isinstance(target, build.SharedLibrary) or has_shared_deps: # add prefer-dynamic if any of the Rust libraries we link # against are dynamic, otherwise we'll end up with |