Skip to content

Commit 7540719

Browse files
authored
Update sort_check_output.py
1 parent e0abe39 commit 7540719

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

volumes/sort_check_output.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
TASK_RE = re.compile(r'\[\s*(\d+)\]')
77

88
def task_id(line):
9-
match = TASK_RE.search(line)
10-
return int(match.group(1)) if match else 0
9+
found = TASK_RE.match(line)
10+
return int(match.group(1)) if found else 0
1111

1212
for line in sorted(fileinput.input(), key=task_id):
1313
print(line, end='')

0 commit comments

Comments
 (0)