Skip to content

Commit 796fb3e

Browse files
committed
Use margin as the loop index variable
1 parent 850c07a commit 796fb3e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Lib/textwrap.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -439,11 +439,9 @@ def dedent(text):
439439
non_blank_lines = [l for l in lines if l and not l.isspace()]
440440
l1 = min(non_blank_lines)
441441
l2 = max(non_blank_lines)
442-
margin = 0
443-
for i, c in enumerate(l1):
444-
if c != l2[i] or c not in ' \t':
442+
for margin, c in enumerate(l1):
443+
if c != l2[margin] or c not in ' \t':
445444
break
446-
margin += 1
447445

448446
return '\n'.join([l[margin:] if l and not l.isspace() else ''
449447
for l in lines])

0 commit comments

Comments
 (0)