Iterate directly over list in readIndex()

No need for range(len.. and later use of index...
This commit is contained in:
digitalfrost 2022-08-08 10:33:32 +02:00
parent 81a34d1d18
commit e54c859b2d

View file

@ -866,13 +866,13 @@ def readIndex(node, attr):
v = readIntArray(node, attr, [])
chunks = []
chunk = []
for i in range(len(v)):
if v[i] == -1:
for i in v:
if i == -1:
if chunk:
chunks.append(chunk)
chunk = []
else:
chunk.append(v[i])
chunk.append(i)
if chunk:
chunks.append(chunk)
return chunks