Skip to content

Commit 8a3db05

Browse files
committed
[Python][CodeQL] Clean up unused loop iteration variables
1 parent ab073ce commit 8a3db05

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

bindings/pyroot/pythonizations/test/ttree_iterable.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,45 +64,45 @@ def get_ntuples(self):
6464

6565
# Tests
6666
def test_basic_type_branch(self):
67-
f,t,c = self.get_tree_and_chain()
67+
_,t,c = self.get_tree_and_chain()
6868

6969
for ds in t,c:
7070
n = array('f', [ 0. ])
7171
ds.SetBranchAddress('floatb', n)
7272

7373
i = 0
74-
for entry in ds:
74+
for _ in ds:
7575
self.assertEqual(n[0], i+self.more)
7676
i = (i + 1) % self.nentries
7777

7878
def test_array_branch(self):
79-
f,t,c = self.get_tree_and_chain()
79+
_,t,c = self.get_tree_and_chain()
8080

8181
for ds in t,c:
8282
a = array('d', self.arraysize*[ 0. ])
8383
ds.SetBranchAddress('arrayb', a)
8484

8585
i = 0
86-
for entry in ds:
86+
for _ in ds:
8787
for j in range(self.arraysize):
8888
self.assertEqual(a[j], i+j)
8989
i = (i + 1) % self.nentries
9090

9191
def test_struct_branch(self):
92-
f,t,c = self.get_tree_and_chain()
92+
_,t,c = self.get_tree_and_chain()
9393

9494
for ds in t,c:
9595
ms = ROOT.MyStruct()
9696
ds.SetBranchAddress('structleaflistb', ms)
9797

9898
i = 0
99-
for entry in ds:
99+
for _ in ds:
100100
self.assertEqual(ms.myint1, i+self.more)
101101
self.assertEqual(ms.myint2, i*self.more)
102102
i = (i + 1) % self.nentries
103103

104104
def test_ntuples(self):
105-
f,nt,ntd = self.get_ntuples()
105+
_,nt,ntd = self.get_ntuples()
106106

107107
colnames = ['x','y','z']
108108
cols = [ array('f', [ 0. ]) for _ in colnames ]
@@ -115,7 +115,7 @@ def test_ntuples(self):
115115

116116
numentry = 0
117117

118-
for entry in ds:
118+
for _ in ds:
119119
for i in range(ncols):
120120
self.assertEqual(cs[i][0], numentry + i*self.more)
121121
numentry += 1

0 commit comments

Comments
 (0)