From nobody Fri Nov 1 03:45:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 152279486441855.44185971942511; Tue, 3 Apr 2018 15:34:24 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 6BC86226085BF; Tue, 3 Apr 2018 15:34:13 -0700 (PDT) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 73F53224A9EAE for ; Tue, 3 Apr 2018 15:34:11 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Apr 2018 15:34:10 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga001.jf.intel.com with ESMTP; 03 Apr 2018 15:34:09 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.120; helo=mga04.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,403,1517904000"; d="scan'208";a="44656113" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Tue, 3 Apr 2018 15:34:06 -0700 Message-Id: <82688ac8bacbc1a1d2fbfade3d48d6934fb6b03d.1522794781.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 5/5] BaseTools: remove redundant check X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The RegEx matches begining and end of the string, dont then check length. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/AutoGen/IdfClassObject.py | 2 +- BaseTools/Source/Python/AutoGen/UniClassObject.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/IdfClassObject.py b/BaseTools/= Source/Python/AutoGen/IdfClassObject.py index a028aceee927..6953854a5247 100644 --- a/BaseTools/Source/Python/AutoGen/IdfClassObject.py +++ b/BaseTools/Source/Python/AutoGen/IdfClassObject.py @@ -107,7 +107,7 @@ class IdfFileClassObject(object): if Len =3D=3D 4 and LineDetails[2] !=3D 'TRANSPARENT': EdkLogger.error("Image Definition File Parser", PARSER= _ERROR, 'Please use the keyword "TRANSPARENT" to describe the transparency = setting in Line %s of File %s.' % (LineNo, File.Path)) MatchString =3D gIdentifierPattern.match(LineDetails[1]) - if MatchString is None or MatchString.end(0) !=3D len(Line= Details[1]): + if MatchString is None: EdkLogger.error('Image Definition File Parser', FORMA= T_INVALID, 'The Image token name %s defined in Idf file %s contains the inv= alid character.' % (LineDetails[1], File.Path)) if LineDetails[1] not in self.ImageIDList: self.ImageIDList.append(LineDetails[1]) diff --git a/BaseTools/Source/Python/AutoGen/UniClassObject.py b/BaseTools/= Source/Python/AutoGen/UniClassObject.py index 8b0c563a8c88..5b879d784d9c 100644 --- a/BaseTools/Source/Python/AutoGen/UniClassObject.py +++ b/BaseTools/Source/Python/AutoGen/UniClassObject.py @@ -352,7 +352,7 @@ class UniFileClassObject(object): # Check the string name if Name !=3D '': MatchString =3D gIdentifierPattern.match(Name) - if MatchString is None or MatchString.end(0) !=3D len(Name): + if MatchString is None: EdkLogger.error('Unicode File Parser', FORMAT_INVALID, 'Th= e string token name %s defined in UNI file %s contains the invalid characte= r.' % (Name, self.File)) LanguageList =3D Item.split(u'#language ') for IndexI in range(len(LanguageList)): @@ -522,7 +522,7 @@ class UniFileClassObject(object): # Check the string name if not self.IsCompatibleMode and Name !=3D '': MatchString =3D gIdentifierPattern.match(Name) - if MatchString is None or MatchString.end(0) !=3D len(= Name): + if MatchString is None: EdkLogger.error('Unicode File Parser', FORMAT_INVA= LID, 'The string token name %s defined in UNI file %s contains the invalid = character.' % (Name, self.File)) self.AddStringToList(Name, Language, Value) continue --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel