From d5e899c76808d45854a06a4ba2b006da32480165 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Wed, 7 Sep 2022 14:03:41 -0700 Subject: pylint: enable the bad_builtin checker This finds uses of deny-listed functions, which defaults to map and filter. These functions should be replaced by comprehensions in idiomatic python because: 1. comprehensions are more heavily optimized and are often faster 2. They avoid the need for lambdas in some cases, which make them faster 3. you can do the equivalent in one statement rather than two, which is faster 4. They're easier to read 5. if you need a concrete instance (ie, a list) then you don't have to convert the iterator to a list afterwards --- mesonbuild/backend/xcodebackend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mesonbuild/backend/xcodebackend.py') diff --git a/mesonbuild/backend/xcodebackend.py b/mesonbuild/backend/xcodebackend.py index 9e101ce..c56036b 100644 --- a/mesonbuild/backend/xcodebackend.py +++ b/mesonbuild/backend/xcodebackend.py @@ -541,7 +541,7 @@ class XCodeBackend(backends.Backend): self.custom_aggregate_targets = {} self.build_all_tdep_id = self.gen_id() # FIXME: filter out targets that are not built by default. - target_dependencies = list(map(lambda t: self.pbx_dep_map[t], self.build_targets)) + target_dependencies = [self.pbx_dep_map[t] for t in self.build_targets] custom_target_dependencies = [self.pbx_custom_dep_map[t] for t in self.custom_targets] aggregated_targets = [] aggregated_targets.append((self.all_id, 'ALL_BUILD', -- cgit v1.1