From nobody Tue Feb 10 05:39:55 2026 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 1522194184916329.0065344896701; Tue, 27 Mar 2018 16:43:04 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id F2FC12205B92F; Tue, 27 Mar 2018 16:36:20 -0700 (PDT) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 BFDF121F85E64 for ; Tue, 27 Mar 2018 16:36:16 -0700 (PDT) Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Mar 2018 16:42:52 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga008.jf.intel.com with ESMTP; 27 Mar 2018 16:42:52 -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=134.134.136.100; helo=mga07.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,368,1517904000"; d="scan'208";a="28995264" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Tue, 27 Mar 2018 16:42:47 -0700 Message-Id: <76b0832a94769d586d234dfeb59fa94acd12aeb7.1522194073.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 4/4] BaseTools: dont use enumerate when un-needed 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" Since we only use the item from the list and not the numeric value, dont bother with enumerate() Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/Common/Expression.py | 4 ++-- BaseTools/Source/Python/Common/Misc.py | 2 +- BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/BaseTools/Source/Python/Common/Expression.py b/BaseTools/Sourc= e/Python/Common/Expression.py index 340c50ebe00f..f28d770aad94 100644 --- a/BaseTools/Source/Python/Common/Expression.py +++ b/BaseTools/Source/Python/Common/Expression.py @@ -856,7 +856,7 @@ class ValueExpressionEx(ValueExpression): LabelDict =3D {} NewPcdValueList =3D [] LabelOffset =3D 0 - for Index, Item in enumerate(PcdValueList): + for Item in PcdValueList: # compute byte offset of every LABEL LabelList =3D _ReLabel.findall(Item) Item =3D _ReLabel.sub('', Item) @@ -882,7 +882,7 @@ class ValueExpressionEx(ValueExpression): except: LabelOffset =3D LabelOffset + 1 =20 - for Index, Item in enumerate(PcdValueList): + for Item in PcdValueList: # for LABEL parse Item =3D Item.strip() try: diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Pyth= on/Common/Misc.py index 7d44fdcf8ba7..8f479ace4cb1 100644 --- a/BaseTools/Source/Python/Common/Misc.py +++ b/BaseTools/Source/Python/Common/Misc.py @@ -76,7 +76,7 @@ def GetVariableOffset(mapfilepath, efifilepath, varnames): def _parseForXcode(lines, efifilepath, varnames): status =3D 0 ret =3D [] - for index, line in enumerate(lines): + for line in lines: line =3D line.strip() if status =3D=3D 0 and line =3D=3D "# Symbols:": status =3D 1 diff --git a/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py b= /BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py index fdad5a44dc3d..0a701158e2c2 100644 --- a/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py +++ b/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py @@ -65,7 +65,7 @@ def parsePcdInfoFromMapFile(mapfilepath, efifilepath): def _parseForXcode(lines, efifilepath): status =3D 0 pcds =3D [] - for index, line in enumerate(lines): + for line in lines: line =3D line.strip() if status =3D=3D 0 and line =3D=3D "# Symbols:": status =3D 1 --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel