From 2ced5e02eacfc6b9e67435fe3a24dcb6c3a29037 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Mon, 31 Mar 2025 15:58:51 -0600 Subject: measurestack: Compile all regexes upfront --- build-aux/measurestack/util.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'build-aux/measurestack/util.py') diff --git a/build-aux/measurestack/util.py b/build-aux/measurestack/util.py index e878ffa..5367da9 100644 --- a/build-aux/measurestack/util.py +++ b/build-aux/measurestack/util.py @@ -37,8 +37,10 @@ def synthetic_node( return n +re_location = re.compile(r"(?P.+):(?P[0-9]+):(?P[0-9]+)") + + def read_source(location: str) -> str: - re_location = re.compile(r"(?P.+):(?P[0-9]+):(?P[0-9]+)") m = re_location.fullmatch(location) if not m: raise ValueError(f"unexpected label value {location!r}") -- cgit v1.2.3-2-g168b