]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
moveconfig: Use re.fullmatch() to avoid extra check
authorSimon Glass <sjg@chromium.org>
Sun, 6 Mar 2022 03:18:54 +0000 (20:18 -0700)
committerSimon Glass <sjg@chromium.org>
Sat, 19 Mar 2022 01:24:24 +0000 (19:24 -0600)
Simplify the code by using the available function.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
tools/moveconfig.py

index ecc6e16c6c8571a552f0ab6baf39cb320e342f51..84bc875fff8efcf15d7acadce3a0944bf3c1c65d 100755 (executable)
@@ -1607,8 +1607,7 @@ def defconfig_matches(configs, re_match):
         bool: True if any CONFIG matches the regex
     """
     for cfg in configs:
-        m_cfg = re_match.match(cfg)
-        if m_cfg and m_cfg.span()[1] == len(cfg):
+        if re_match.fullmatch(cfg):
             return True
     return False