Skip to content

Commit 5f9b9fc

Browse files
committed
Refactor to enhance readability.
1 parent 53ce1d1 commit 5f9b9fc

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

llvm/utils/UpdateTestChecks/common.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1907,13 +1907,12 @@ def escape_braces(match_obj):
19071907
line,
19081908
)
19091909
break
1910-
scrubbed_line = (
1910+
if ignore_all_comments:
19111911
# Ignore any comments, since the check lines will too.
1912-
SCRUB_IR_COMMENT_RE.sub(r"", line)
1913-
if ignore_all_comments
1912+
scrubbed_line = SCRUB_IR_COMMENT_RE.sub(r"", line)
1913+
else:
19141914
# Ignore comments of predecessors only.
1915-
else SCRUB_PRED_COMMENT_RE.sub(r"", line)
1916-
)
1915+
scrubbed_line = SCRUB_PRED_COMMENT_RE.sub(r"", line)
19171916
# Ignore the metadata details if check global is none
19181917
if no_meta_details:
19191918
scrubbed_line = SCRUB_IR_FUNC_META_RE.sub(r"{{.*}}", scrubbed_line)

0 commit comments

Comments
 (0)