From 8252e6bf2ddfa210992c3590008029933592ad16 Mon Sep 17 00:00:00 2001 From: "Carsey, Jaben" Date: Sat, 28 Apr 2018 06:32:54 +0800 Subject: BaseTools: dont make iterator into list if not needed functions (like join) can use the iterator just as easily. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu --- BaseTools/Source/Python/Workspace/DscBuildData.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'BaseTools/Source/Python/Workspace/DscBuildData.py') diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py index da1e9ac427..627a157926 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -1514,7 +1514,7 @@ class DscBuildData(PlatformBuildClassObject): return len(Value) - 2 return len(Value) - return str(max([pcd_size for pcd_size in [get_length(item) for item in sku_values]])) + return str(max(get_length(item) for item in sku_values)) @staticmethod def ExecuteCommand (Command): @@ -2078,7 +2078,7 @@ class DscBuildData(PlatformBuildClassObject): SearchPathList = [] SearchPathList.append(os.path.normpath(mws.join(GlobalData.gWorkspace, "BaseTools/Source/C/Include"))) SearchPathList.append(os.path.normpath(mws.join(GlobalData.gWorkspace, "BaseTools/Source/C/Common"))) - SearchPathList.extend([str(item) for item in IncSearchList]) + SearchPathList.extend(str(item) for item in IncSearchList) IncFileList = GetDependencyList(IncludeFileFullPaths,SearchPathList) for include_file in IncFileList: MakeApp += "$(OBJECTS) : %s\n" % include_file @@ -2324,7 +2324,7 @@ class DscBuildData(PlatformBuildClassObject): if PcdType in [self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII], self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]]: for skuid in PcdObj.SkuInfoList: skuobj = PcdObj.SkuInfoList[skuid] - mindefaultstorename = DefaultStoreObj.GetMin(set([defaultstorename for defaultstorename in skuobj.DefaultStoreDict])) + mindefaultstorename = DefaultStoreObj.GetMin(set(defaultstorename for defaultstorename in skuobj.DefaultStoreDict)) for defaultstorename in DefaultStores: if defaultstorename not in skuobj.DefaultStoreDict: skuobj.DefaultStoreDict[defaultstorename] = copy.deepcopy(skuobj.DefaultStoreDict[mindefaultstorename]) -- cgit v1.2.3