public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Jaben Carsey <jaben.carsey@intel.com>
To: edk2-devel@lists.01.org
Cc: Liming Gao <liming.gao@intel.com>, Yonghong Zhu <yonghong.zhu@intel.com>
Subject: [PATCH v1 4/5] BaseTools: use set instead of list for a variable to be used with in
Date: Tue, 10 Apr 2018 16:17:23 -0700	[thread overview]
Message-ID: <6349886e15f3085cc5636f73b1c85eeb55e9eb9d.1523402167.git.jaben.carsey@intel.com> (raw)
In-Reply-To: <cover.1523402167.git.jaben.carsey@intel.com>
In-Reply-To: <cover.1523402167.git.jaben.carsey@intel.com>

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
---
 BaseTools/Source/Python/AutoGen/AutoGen.py | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py
index 8adb2527c79f..57f1a0d8ba06 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -1450,13 +1450,10 @@ class PlatformAutoGen(AutoGen):
                         self._NonDynaPcdList_.remove (self._NonDynaPcdList_[Index])
                         PcdFromModule.Pending = False
                         self._NonDynaPcdList_.append (PcdFromModule)
-        # Parse the DynamicEx PCD from the AsBuild INF module list of FDF.
-        DscModuleList = []
-        for ModuleInf in self.Platform.Modules.keys():
-            DscModuleList.append (os.path.normpath(ModuleInf.Path))
+        DscModuleSet = {os.path.normpath(ModuleInf.Path) for ModuleInf in self.Platform.Modules}
         # add the PCD from modules that listed in FDF but not in DSC to Database 
         for InfName in FdfModuleList:
-            if InfName not in DscModuleList:
+            if InfName not in DscModuleSet:
                 InfClass = PathClass(InfName)
                 M = self.BuildDatabase[InfClass, self.Arch, self.BuildTarget, self.ToolChain]
                 # If a module INF in FDF but not in current arch's DSC module list, it must be module (either binary or source) 
-- 
2.16.2.windows.1



  parent reply	other threads:[~2018-04-10 23:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-10 23:17 [PATCH v1 0/5] BaseTools: remove or change un-needed variables Jaben Carsey
2018-04-10 23:17 ` [PATCH v1 1/5] BaseTools: use existing shared variable Jaben Carsey
2018-04-10 23:17 ` [PATCH v1 2/5] BaseTools: no need to save the data Jaben Carsey
2018-04-10 23:17 ` [PATCH v1 3/5] BaseTools: skip updating temporary variable Jaben Carsey
2018-04-10 23:17 ` Jaben Carsey [this message]
2018-04-10 23:17 ` [PATCH v1 5/5] BaseTools: reduce list usage when not needed Jaben Carsey
2018-04-17 12:42 ` [PATCH v1 0/5] BaseTools: remove or change un-needed variables Zhu, Yonghong

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=6349886e15f3085cc5636f73b1c85eeb55e9eb9d.1523402167.git.jaben.carsey@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