From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 76395C433F5 for ; Thu, 3 Mar 2022 21:15:58 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 72DC283CD8; Thu, 3 Mar 2022 22:15:29 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="kBycylse"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 11D7683BAE; Thu, 3 Mar 2022 22:15:27 +0100 (CET) Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8C0CF83CA8 for ; Thu, 3 Mar 2022 22:15:23 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=alpernebiyasak@gmail.com Received: by mail-ej1-x634.google.com with SMTP id yy13so4515188ejb.2 for ; Thu, 03 Mar 2022 13:15:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:from:subject:to:cc :references:content-language:in-reply-to:content-transfer-encoding; bh=hikmdC3o1PdP72++Z69nswbewXAyWUX7tKtafdNsPMM=; b=kBycylsedc0+Z+p7ViAtTZHDK6jscAkAnS6iqMPLChsSKrcXqMFdkSECasEI7K67yg Vpddg5W0dT/7WWaXvWLyNRNmWbqFhDC6ETI5c6RDT798wfa1c1K6XEhdjUMCCEjhO4D9 sziS89/BQp2I6vxA+3UUD67DjNcV9YpYgQr3CcDq1z+YXHMil2KVPl5p6dGqmYBzCAfa 7CyPYb/d3M39KXT/ihPJU7xulZnknunzroV4Ihlu8BrtvspPsM9Xjhju9URFMhFy87dj XbM13jo1Qc8JnM3KICqnZ0sARlv3LRvfa+cjVRrDLNDeuyyY2lWGqcIRzw2roYscO7W5 ZRKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:from :subject:to:cc:references:content-language:in-reply-to :content-transfer-encoding; bh=hikmdC3o1PdP72++Z69nswbewXAyWUX7tKtafdNsPMM=; b=XP9yg/W8wnmYcHM5GYxMOsSK+NdVabRU8GkBCOrGj+zYfUTHWeLLhgr0yLGi7n6A0d jjCM3VAiotQ/Lqq9ciVj0wIMCmUkxK/dvvOgvA2uK6mggBQa8O6lC6jD5aTxALoBpee/ Qv3dST/WhMoge2wekmtpma9icOHeJt77Cdj3Wq9BY4LZQ0tVOsP/9TwR79yTsXdMegcm HG/Z2sc7l0fJ3ihgc1tziCxwq1JSSYlQvyBqyv4hsnSTAIond5g5G3JB/Zo5oG3/W3se nPnJb2mq+zlSw5Y/hUC4+zAoF6eX4F7bLLkRCnnKs0/C0ARxw8kyr3RJIIeVKJSKe7W5 vuxw== X-Gm-Message-State: AOAM532r6J2vN8rd1tTPikxelOBmyCKFLqlF3Vqda/GaGrpbhi8hwW6t ldSfAHZlzgT0ePkQ8n96EB4= X-Google-Smtp-Source: ABdhPJwdBY0OhBh7yBQst7/BBfwyxzjMR76W+aM4oC49eoNPywzghvq+SjD+WWK84BrRG//L9YR45g== X-Received: by 2002:a17:907:72c3:b0:6da:b4d1:415a with SMTP id du3-20020a17090772c300b006dab4d1415amr433070ejc.709.1646342123205; Thu, 03 Mar 2022 13:15:23 -0800 (PST) Received: from [192.168.0.74] ([178.233.26.119]) by smtp.gmail.com with ESMTPSA id i5-20020a05640242c500b00415db19d6b0sm1226721edc.76.2022.03.03.13.15.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Mar 2022 13:15:22 -0800 (PST) Message-ID: <6ac3fd29-56d0-5201-e31c-6385732cb7cb@gmail.com> Date: Fri, 4 Mar 2022 00:07:59 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 From: Alper Nebi Yasak Subject: Re: [PATCH v2 03/25] moveconfig: Use re.fullmatch() to avoid extra check To: Simon Glass Cc: Ivan Mikhaylov , Tom Rini , Philippe Reynes , huang lin , Jeffy Chen , Kever Yang , U-Boot Mailing List References: <20220223230040.159317-1-sjg@chromium.org> <20220223230040.159317-4-sjg@chromium.org> Content-Language: en-US In-Reply-To: <20220223230040.159317-4-sjg@chromium.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean On 24/02/2022 02:00, Simon Glass wrote: > Simplify the code by using the available function. > > Signed-off-by: Simon Glass > --- > > Changes in v2: > - Add new patch to use re.fullmatch() to avoid extra check > > tools/moveconfig.py | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Alper Nebi Yasak > diff --git a/tools/moveconfig.py b/tools/moveconfig.py > index dea60f4661..4b0e2e250b 100755 > --- a/tools/moveconfig.py > +++ b/tools/moveconfig.py > @@ -1610,8 +1610,8 @@ 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): > + m_cfg = re_match.fullmatch(cfg) > + if m_cfg: Could skip the variable entirely. > return True > return False >