Skip to content

Commit 213edc9

Browse files
Refactor loop to use enumerate for index tracking
1 parent 221161a commit 213edc9

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

ciphers/base62.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,9 @@ def base62_decode(string_val: str) -> int:
3939
strlen = len(string_val)
4040
num = 0
4141

42-
idx = 0
43-
for char in string_val:
42+
for idx, char in enumerate(string_val):
4443
power = strlen - (idx + 1)
4544
num += CHARSET.index(char) * (base**power)
46-
idx += 1
4745
return num
4846

4947

0 commit comments

Comments
 (0)