From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.120; helo=mga04.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org 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 37F50210ED79E for ; Wed, 15 Aug 2018 08:54:23 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Aug 2018 08:54:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,243,1531810800"; d="scan'208";a="66404264" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga006.jf.intel.com with ESMTP; 15 Aug 2018 08:54:15 -0700 Received: from fmsmsx126.amr.corp.intel.com (10.18.125.43) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 15 Aug 2018 08:54:15 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX126.amr.corp.intel.com (10.18.125.43) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 15 Aug 2018 08:54:15 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.143]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.205]) with mapi id 14.03.0319.002; Wed, 15 Aug 2018 23:54:13 +0800 From: "Gao, Liming" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [Patch] BaseTools: Remove the redundant if statement Thread-Index: AQHUMHY1oRZ8GYRmxku4L0Prw7h936TA/3cw Date: Wed, 15 Aug 2018 15:54:12 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E2E3922@SHSMSX104.ccr.corp.intel.com> References: <1533883721-9532-1-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1533883721-9532-1-git-send-email-yonghong.zhu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYWEwMjJlMDctOTYwOS00ZTgxLWFiZTItZjhkMWI3NWFjYmJjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiMVdBWnNJWURvbEtQK0VCKzhtQXJmTWJTWERBc0NnakwxOHdcLzJOaVVHNzloNytDM0t4Z3RlWTBSSjlmSVhUSm0ifQ== dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [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: , X-List-Received-Date: Wed, 15 Aug 2018 15:54:23 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Zh= u, Yonghong > Sent: Thursday, August 9, 2018 11:49 PM > To: edk2-devel@lists.01.org > Cc: Gao, Liming > Subject: [edk2] [Patch] BaseTools: Remove the redundant if statement >=20 > after analysis the BuildOptionValue function, we found the if statement > IsFieldValueAnArray is redundant because ValueExpressionEx will handle > it. >=20 > Cc: Liming Gao > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Yonghong Zhu > --- > BaseTools/Source/Python/Common/Expression.py | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) >=20 > diff --git a/BaseTools/Source/Python/Common/Expression.py b/BaseTools/Sou= rce/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, IsFi= eldValueAnArray > +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, GuidDic= t)(True) > - except: > - pass > + try: > + PcdValue =3D ValueExpressionEx(InputValue, TAB_VOID, GuidDict)(T= rue) > + except: > + pass > + > return PcdValue >=20 > ## ReplaceExprMacro > # > def ReplaceExprMacro(String, Macros, ExceptionList =3D None): > -- > 2.6.1.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel