From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (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 83E1D224CCC11 for ; Tue, 13 Mar 2018 16:05:23 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Mar 2018 16:11:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,466,1515484800"; d="scan'208";a="207954913" Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga005.jf.intel.com with ESMTP; 13 Mar 2018 16:11:45 -0700 From: Jaben Carsey To: edk2-devel@lists.01.org Cc: Yonghong Zhu , Liming Gao Date: Tue, 13 Mar 2018 16:11:31 -0700 Message-Id: X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [PATCH v1 1/5] BaseTools: Expression - remove redundant variable X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 23:05:24 -0000 Str is created and not needed. Cc: Yonghong Zhu Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/Common/Expression.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/BaseTools/Source/Python/Common/Expression.py b/BaseTools/Source/Python/Common/Expression.py index e76f09c367c1..bcb27ec11fd5 100644 --- a/BaseTools/Source/Python/Common/Expression.py +++ b/BaseTools/Source/Python/Common/Expression.py @@ -46,14 +46,13 @@ ERR_IN_OPERAND = 'Macro after IN operator can only be: $(FAMILY), $(ARC # def SplitString(String): # There might be escaped quote: "abc\"def\\\"ghi", 'abc\'def\\\'ghi' - Str = String RetList = [] InSingleQuote = False InDoubleQuote = False Item = '' - for i, ch in enumerate(Str): + for i, ch in enumerate(String): if ch == '"' and not InSingleQuote: - if Str[i - 1] != '\\': + if String[i - 1] != '\\': InDoubleQuote = not InDoubleQuote if not InDoubleQuote: Item += String[i] @@ -64,7 +63,7 @@ def SplitString(String): RetList.append(Item) Item = '' elif ch == "'" and not InDoubleQuote: - if Str[i - 1] != '\\': + if String[i - 1] != '\\': InSingleQuote = not InSingleQuote if not InSingleQuote: Item += String[i] @@ -84,13 +83,12 @@ def SplitString(String): def SplitPcdValueString(String): # There might be escaped comma in GUID() or DEVICE_PATH() or " " # or ' ' or L' ' or L" " - Str = String RetList = [] InParenthesis = 0 InSingleQuote = False InDoubleQuote = False Item = '' - for i, ch in enumerate(Str): + for i, ch in enumerate(String): if ch == '(': InParenthesis += 1 if ch == ')': -- 2.16.2.windows.1