Skip to content

Commit

Permalink
Use enumerate for list
Browse files Browse the repository at this point in the history
  • Loading branch information
juztas committed Oct 9, 2023
1 parent e7a3479 commit c5c56e9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/python/SiteRMLibs/ipaddr.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ def _ipv6InJavaFormat(ipinput):
tmpval = str(item)
tmparr = []
stoploop = False
for i in range(len(tmpval)):
for i in enumerate(tmpval):
if not stoploop:
if tmpval[i] != '0':
tmparr.append(tmpval[i])
if i[1] != '0':
tmparr.append(i[1])
stoploop = True
continue
tmparr.append(tmpval[i])
tmparr.append(i[1])
if not tmparr:
tmparr.append('0')
out.append("".join(tmparr))
Expand Down

0 comments on commit c5c56e9

Please sign in to comment.