From nobody Mon Apr 22 23:45:58 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; dmarc=fail(p=none dis=none) header.from=intel.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 153388372851913.574613408240111; Thu, 9 Aug 2018 23:48:48 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 2A5CC21A00AE6; Thu, 9 Aug 2018 23:48:47 -0700 (PDT) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 0027E21BADAB2 for ; Thu, 9 Aug 2018 23:48:44 -0700 (PDT) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Aug 2018 23:48:44 -0700 Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.129]) by orsmga005.jf.intel.com with ESMTP; 09 Aug 2018 23:48:43 -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.20; helo=mga02.intel.com; envelope-from=yonghong.zhu@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.53,218,1531810800"; d="scan'208";a="247696782" From: Yonghong Zhu To: edk2-devel@lists.01.org Date: Fri, 10 Aug 2018 14:48:41 +0800 Message-Id: <1533883721-9532-1-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 Subject: [edk2] [Patch] BaseTools: Remove the redundant if statement X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 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: RDMRC_1 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" after analysis the BuildOptionValue function, we found the if statement IsFieldValueAnArray is redundant because ValueExpressionEx will handle it. Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu Reviewed-by: Liming Gao --- BaseTools/Source/Python/Common/Expression.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/BaseTools/Source/Python/Common/Expression.py b/BaseTools/Sourc= e/Python/Common/Expression.py index ccc7368..0091e47 100644 --- a/BaseTools/Source/Python/Common/Expression.py +++ b/BaseTools/Source/Python/Common/Expression.py @@ -15,11 +15,11 @@ from __future__ import print_function from __future__ import absolute_import from Common.GlobalData import * from CommonDataClass.Exceptions import BadExpression from CommonDataClass.Exceptions import WrnExpression -from .Misc import GuidStringToGuidStructureString, ParseFieldValue, IsFiel= dValueAnArray +from .Misc import GuidStringToGuidStructureString, ParseFieldValue import Common.EdkLogger as EdkLogger import copy from Common.DataType import * import sys =20 @@ -136,15 +136,15 @@ def BuildOptionValue(PcdValue, GuidDict): InputValue =3D PcdValue elif PcdValue.startswith('L'): InputValue =3D 'L"' + PcdValue[1:] + '"' else: InputValue =3D PcdValue - if IsFieldValueAnArray(InputValue): - try: - PcdValue =3D ValueExpressionEx(InputValue, TAB_VOID, GuidDict)= (True) - except: - pass + try: + PcdValue =3D ValueExpressionEx(InputValue, TAB_VOID, GuidDict)(Tru= e) + except: + pass + return PcdValue =20 ## ReplaceExprMacro # def ReplaceExprMacro(String, Macros, ExceptionList =3D None): --=20 2.6.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel