BaseTools: refactor and remove un-needed use of .keys() on dictionaries
sometimes just delete it. sometimes the loop needed .values() instead 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> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
This commit is contained in:
committed by
Yonghong Zhu
parent
55c84777ee
commit
9eb87141ec
@ -788,10 +788,7 @@ class InfBuildData(ModuleBuildClassObject):
|
||||
self._Includes.append(self._SourceOverridePath)
|
||||
|
||||
Macros = self._Macros
|
||||
if 'PROCESSOR' in GlobalData.gEdkGlobal.keys():
|
||||
Macros['PROCESSOR'] = GlobalData.gEdkGlobal['PROCESSOR']
|
||||
else:
|
||||
Macros['PROCESSOR'] = self._Arch
|
||||
Macros['PROCESSOR'] = GlobalData.gEdkGlobal.get('PROCESSOR', self._Arch)
|
||||
RecordList = self._RawData[MODEL_EFI_INCLUDE, self._Arch, self._Platform]
|
||||
for Record in RecordList:
|
||||
if Record[0].find('EDK_SOURCE') > -1:
|
||||
|
@ -1504,12 +1504,12 @@ class DscParser(MetaFileParser):
|
||||
# Allow using system environment variables in path after !include
|
||||
#
|
||||
__IncludeMacros['WORKSPACE'] = GlobalData.gGlobalDefines['WORKSPACE']
|
||||
if "ECP_SOURCE" in GlobalData.gGlobalDefines.keys():
|
||||
if "ECP_SOURCE" in GlobalData.gGlobalDefines:
|
||||
__IncludeMacros['ECP_SOURCE'] = GlobalData.gGlobalDefines['ECP_SOURCE']
|
||||
#
|
||||
# During GenFds phase call DSC parser, will go into this branch.
|
||||
#
|
||||
elif "ECP_SOURCE" in GlobalData.gCommandLineDefines.keys():
|
||||
elif "ECP_SOURCE" in GlobalData.gCommandLineDefines:
|
||||
__IncludeMacros['ECP_SOURCE'] = GlobalData.gCommandLineDefines['ECP_SOURCE']
|
||||
|
||||
__IncludeMacros['EFI_SOURCE'] = GlobalData.gGlobalDefines['EFI_SOURCE']
|
||||
|
@ -1,7 +1,7 @@
|
||||
## @file
|
||||
# Common routines used by workspace
|
||||
#
|
||||
# Copyright (c) 2012 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
# This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
# which accompanies this distribution. The full text of the license may be found at
|
||||
@ -63,11 +63,11 @@ def GetDeclaredPcd(Platform, BuildDatabase, Arch, Target, Toolchain,additionalPk
|
||||
PcdCName = Pcd[0]
|
||||
PcdTokenName = Pcd[1]
|
||||
if GlobalData.MixedPcd:
|
||||
for PcdItem in GlobalData.MixedPcd.keys():
|
||||
for PcdItem in GlobalData.MixedPcd:
|
||||
if (PcdCName, PcdTokenName) in GlobalData.MixedPcd[PcdItem]:
|
||||
PcdCName = PcdItem[0]
|
||||
break
|
||||
if (PcdCName, PcdTokenName) not in DecPcds.keys():
|
||||
if (PcdCName, PcdTokenName) not in DecPcds:
|
||||
DecPcds[PcdCName, PcdTokenName] = Pkg.Pcds[Pcd]
|
||||
return DecPcds, GuidDict
|
||||
|
||||
@ -243,7 +243,7 @@ def _ResolveLibraryReference(Module, Platform):
|
||||
for LibraryName in M.Libraries:
|
||||
Library = Platform.LibraryClasses[LibraryName, ':dummy:']
|
||||
if Library is None:
|
||||
for Key in Platform.LibraryClasses.data.keys():
|
||||
for Key in Platform.LibraryClasses.data:
|
||||
if LibraryName.upper() == Key.upper():
|
||||
Library = Platform.LibraryClasses[Key, ':dummy:']
|
||||
break
|
||||
|
Reference in New Issue
Block a user