From: "Gao, Liming" <liming.gao@intel.com>
To: "Zhu, Yonghong" <yonghong.zhu@intel.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: [Patch] BaseTools: Remove the redundant if statement
Date: Wed, 15 Aug 2018 15:54:12 +0000 [thread overview]
Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E2E3922@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <1533883721-9532-1-git-send-email-yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Zhu, Yonghong
> Sent: Thursday, August 9, 2018 11:49 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming <liming.gao@intel.com>
> Subject: [edk2] [Patch] BaseTools: Remove the redundant if statement
>
> after analysis the BuildOptionValue function, we found the if statement
> IsFieldValueAnArray is redundant because ValueExpressionEx will handle
> it.
>
> Cc: Liming Gao <liming.gao@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
> ---
> 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/Source/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, IsFieldValueAnArray
> +from .Misc import GuidStringToGuidStructureString, ParseFieldValue
> import Common.EdkLogger as EdkLogger
> import copy
> from Common.DataType import *
> import sys
>
> @@ -136,15 +136,15 @@ def BuildOptionValue(PcdValue, GuidDict):
> InputValue = PcdValue
> elif PcdValue.startswith('L'):
> InputValue = 'L"' + PcdValue[1:] + '"'
> else:
> InputValue = PcdValue
> - if IsFieldValueAnArray(InputValue):
> - try:
> - PcdValue = ValueExpressionEx(InputValue, TAB_VOID, GuidDict)(True)
> - except:
> - pass
> + try:
> + PcdValue = ValueExpressionEx(InputValue, TAB_VOID, GuidDict)(True)
> + except:
> + pass
> +
> return PcdValue
>
> ## ReplaceExprMacro
> #
> def ReplaceExprMacro(String, Macros, ExceptionList = None):
> --
> 2.6.1.windows.1
>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
prev parent reply other threads:[~2018-08-15 15:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-10 6:48 [Patch] BaseTools: Remove the redundant if statement Yonghong Zhu
2018-08-15 15:54 ` Gao, Liming [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A89E2EF3DFEDB4C8BFDE51014F606A14E2E3922@SHSMSX104.ccr.corp.intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox