From 30d3fda8d2c8e2b2cdee6426d8dad7c0e46036b8 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Fri, 2 Jun 2023 22:14:08 -0700 Subject: [PATCH] get first by search --- selfdrive/car/hyundai/values.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/selfdrive/car/hyundai/values.py b/selfdrive/car/hyundai/values.py index 294c1fe5df..2a43a7a00f 100644 --- a/selfdrive/car/hyundai/values.py +++ b/selfdrive/car/hyundai/values.py @@ -347,9 +347,9 @@ FINGERPRINTS = { def get_platform_codes(fw_versions: List[bytes]) -> Set[bytes]: codes = set() for fw in fw_versions: - matches = re.findall(PLATFORM_CODE_PATTERN, fw) - if len(matches): - codes.add(matches[0]) + match = re.search(PLATFORM_CODE_PATTERN, fw) + if match is not None: + codes.add(match.group()) return codes