From a3d6ac1db5b644393f690367ec898fd43b651e66 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Sat, 20 Apr 2024 17:31:00 -0400 Subject: [PATCH] PERF: Use regex method instead of module function Not sure what `re.compile` is doing before the matching that takes as long as the regex --- tools/check_python_h_first.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/check_python_h_first.py b/tools/check_python_h_first.py index c7eb91008f1d..cfb994bd7787 100644 --- a/tools/check_python_h_first.py +++ b/tools/check_python_h_first.py @@ -62,7 +62,7 @@ def check_python_h_included_first(name_to_check: str) -> int: if "*/" in line: in_comment = False continue - match = re.match(HEADER_PATTERN, line) + match = HEADER_PATTERN.match(line) if match: this_header = match.group(1) if this_header in PYTHON_INCLUDING_HEADERS: