moveconfig: Use re.fullmatch() to avoid extra check

Simplify the code by using the available function.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
This commit is contained in:
Simon Glass 2022-03-05 20:18:54 -07:00
parent 78f12e5369
commit d9c958f49c

View file

@ -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