Skip to content

Commit

Permalink
backend/vs2010: use itertools.chain instead of adding lists
Browse files Browse the repository at this point in the history
The latter of which creates a new list with references to all of the
objects in the inputs. In our case that's wasted as we just iterate
anyway.
  • Loading branch information
dcbaker committed Feb 3, 2025
1 parent 70ddc0d commit a9ab54c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mesonbuild/backend/vs2010backend.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2014-2016 The Meson development team
# Copyright © 2025 Intel Corporation

from __future__ import annotations
import copy
Expand Down Expand Up @@ -1839,7 +1840,7 @@ def path_normalize_add(path: str, lis: T.List[str]) -> bool:
relpath = os.path.join(proj_to_build_root, s.rel_to_builddir(self.build_to_src))
if path_normalize_add(relpath, previous_objects):
ET.SubElement(inc_objs, 'Object', Include=relpath)
for f in additional_objects + explicit_link_gen_objs:
for f in itertools.chain(additional_objects, explicit_link_gen_objs):
if path_normalize_add(f, previous_objects):
ET.SubElement(inc_objs, 'Object', Include=f)

Expand Down

0 comments on commit a9ab54c

Please sign in to comment.