From: Simon Glass Date: Sun, 6 Mar 2022 03:18:54 +0000 (-0700) Subject: moveconfig: Use re.fullmatch() to avoid extra check X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=d9c958f49c3dd78b3844514fdb8add3cb0793c54;p=u-boot.git moveconfig: Use re.fullmatch() to avoid extra check Simplify the code by using the available function. Signed-off-by: Simon Glass Reviewed-by: Alper Nebi Yasak --- diff --git a/tools/moveconfig.py b/tools/moveconfig.py index ecc6e16c6c..84bc875fff 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -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