diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2021-08-31 10:08:01 -0700 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2021-08-31 16:28:54 -0400 |
commit | b60bd0e299460c436acba43de27ac52afb11026b (patch) | |
tree | d1e66beb2c83625bfc86acbac7ce419980fd5013 /mesonbuild/backend/vs2010backend.py | |
parent | 4d7031437c7a81b52c776d4ae1e32741bdb851ca (diff) | |
download | meson-b60bd0e299460c436acba43de27ac52afb11026b.zip meson-b60bd0e299460c436acba43de27ac52afb11026b.tar.gz meson-b60bd0e299460c436acba43de27ac52afb11026b.tar.bz2 |
pyllint: enable consider-user-enumerate
This caught a couple of cases of us doing:
```python
for i in range(len(x)):
v = x[i]
```
which are places to use enumerate instead.
It also caught a couple of cases of:
```python
assert len(x) == len(y)
for i in range(len(x)):
xv = x[i]
yv = y[i]
```
Which should instead be using zip()
```python
for xv, yv in zip(x, y):
...
```
Diffstat (limited to 'mesonbuild/backend/vs2010backend.py')
-rw-r--r-- | mesonbuild/backend/vs2010backend.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py index 0cf0b72..13cd546 100644 --- a/mesonbuild/backend/vs2010backend.py +++ b/mesonbuild/backend/vs2010backend.py @@ -122,12 +122,11 @@ class Vs2010Backend(backends.Backend): source_dir = os.path.join(down, self.build_to_src, genlist.subdir) exe_arr = self.build_target_to_cmd_array(exe) idgroup = ET.SubElement(parent_node, 'ItemGroup') - for i in range(len(infilelist)): + for i, curfile in enumerate(infilelist): if len(infilelist) == len(outfilelist): sole_output = os.path.join(target_private_dir, outfilelist[i]) else: sole_output = '' - curfile = infilelist[i] infilename = os.path.join(down, curfile.rel_to_builddir(self.build_to_src)) deps = self.get_custom_target_depend_files(genlist, True) base_args = generator.get_arglist(infilename) |