Use walrus operator in crystal regex match

This commit is contained in:
J. Nick Koston
2026-03-06 22:31:38 -10:00
parent 84383755d7
commit d1b2010ed2
+1 -2
View File
@@ -649,8 +649,7 @@ def _make_crystal_freq_callback(
crystal_re = re.compile(r"Crystal frequency:\s+(\d+(?:\.\d+)?)\s*MHz")
def check_crystal_line(line: str) -> str | None:
match = crystal_re.search(line)
if not match:
if not (match := crystal_re.search(line)):
return None
detected = int(float(match.group(1)))
if detected == configured_freq: