BaseTools: dont make iterator into list if not needed
functions (like join) can use the iterator just as easily. 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
4d601fc6b1
commit
8252e6bf2d
@@ -460,7 +460,7 @@ class WorkspaceAutoGen(AutoGen):
|
||||
'build',
|
||||
FORMAT_INVALID,
|
||||
"Building modules from source INFs, following PCD use %s and %s access method. It must be corrected to use only one access method." % (i, j),
|
||||
ExtraData="%s" % '\n\t'.join([str(P[1]+'.'+P[0]) for P in Intersections])
|
||||
ExtraData="%s" % '\n\t'.join(str(P[1]+'.'+P[0]) for P in Intersections)
|
||||
)
|
||||
|
||||
#
|
||||
@@ -2295,7 +2295,7 @@ class PlatformAutoGen(AutoGen):
|
||||
#
|
||||
for Item in LibraryList:
|
||||
if ConsumedByList[Item] != [] and Item in Constructor and len(Constructor) > 1:
|
||||
ErrorMessage = "\tconsumed by " + "\n\tconsumed by ".join([str(L) for L in ConsumedByList[Item]])
|
||||
ErrorMessage = "\tconsumed by " + "\n\tconsumed by ".join(str(L) for L in ConsumedByList[Item])
|
||||
EdkLogger.error("build", BUILD_ERROR, 'Library [%s] with constructors has a cycle' % str(Item),
|
||||
ExtraData=ErrorMessage, File=self.MetaFile)
|
||||
if Item not in SortedLibraryList:
|
||||
@@ -2415,7 +2415,7 @@ class PlatformAutoGen(AutoGen):
|
||||
if Sku.VariableGuid == '': continue
|
||||
Sku.VariableGuidValue = GuidValue(Sku.VariableGuid, self.PackageList, self.MetaFile.Path)
|
||||
if Sku.VariableGuidValue is None:
|
||||
PackageList = "\n\t".join([str(P) for P in self.PackageList])
|
||||
PackageList = "\n\t".join(str(P) for P in self.PackageList)
|
||||
EdkLogger.error(
|
||||
'build',
|
||||
RESOURCE_NOT_AVAILABLE,
|
||||
@@ -3122,7 +3122,7 @@ class ModuleAutoGen(AutoGen):
|
||||
for Depex in DepexList:
|
||||
for key in Depex:
|
||||
DepexStr += '[Depex.%s.%s]\n' % key
|
||||
DepexStr += '\n'.join(['# '+ val for val in Depex[key]])
|
||||
DepexStr += '\n'.join('# '+ val for val in Depex[key])
|
||||
DepexStr += '\n\n'
|
||||
if not DepexStr:
|
||||
return '[Depex.%s]\n' % self.Arch
|
||||
@@ -3136,7 +3136,7 @@ class ModuleAutoGen(AutoGen):
|
||||
DepexStr += ' AND '
|
||||
DepexStr += '('
|
||||
for D in Depex.values():
|
||||
DepexStr += ' '.join([val for val in D])
|
||||
DepexStr += ' '.join(val for val in D)
|
||||
Index = DepexStr.find('END')
|
||||
if Index > -1 and Index == len(DepexStr) - 3:
|
||||
DepexStr = DepexStr[:-3]
|
||||
|
@@ -80,7 +80,7 @@ class VariableMgr(object):
|
||||
try:
|
||||
newvaluestr = "{" + ",".join(VariableMgr.assemble_variable(newvalue)) +"}"
|
||||
except:
|
||||
EdkLogger.error("build", AUTOGEN_ERROR, "Variable offset conflict in PCDs: %s \n" % (" and ".join([item.pcdname for item in sku_var_info_offset_list])))
|
||||
EdkLogger.error("build", AUTOGEN_ERROR, "Variable offset conflict in PCDs: %s \n" % (" and ".join(item.pcdname for item in sku_var_info_offset_list)))
|
||||
n = sku_var_info_offset_list[0]
|
||||
indexedvarinfo[key] = [var_info(n.pcdindex,n.pcdname,n.defaultstoragename,n.skuname,n.var_name, n.var_guid, "0x00",n.var_attribute,newvaluestr , newvaluestr , DataType.TAB_VOID)]
|
||||
self.VarInfo = [item[0] for item in indexedvarinfo.values()]
|
||||
@@ -116,9 +116,9 @@ class VariableMgr(object):
|
||||
default_sku_default = indexedvarinfo[index].get((DataType.TAB_DEFAULT,DataType.TAB_DEFAULT_STORES_DEFAULT))
|
||||
|
||||
if default_sku_default.data_type not in DataType.TAB_PCD_NUMERIC_TYPES:
|
||||
var_max_len = max([len(var_item.default_value.split(",")) for var_item in sku_var_info.values()])
|
||||
var_max_len = max(len(var_item.default_value.split(",")) for var_item in sku_var_info.values())
|
||||
if len(default_sku_default.default_value.split(",")) < var_max_len:
|
||||
tail = ",".join([ "0x00" for i in range(var_max_len-len(default_sku_default.default_value.split(",")))])
|
||||
tail = ",".join("0x00" for i in range(var_max_len-len(default_sku_default.default_value.split(","))))
|
||||
|
||||
default_data_buffer = VariableMgr.PACK_VARIABLES_DATA(default_sku_default.default_value,default_sku_default.data_type,tail)
|
||||
|
||||
@@ -136,7 +136,7 @@ class VariableMgr(object):
|
||||
|
||||
if default_sku_default.data_type not in DataType.TAB_PCD_NUMERIC_TYPES:
|
||||
if len(other_sku_other.default_value.split(",")) < var_max_len:
|
||||
tail = ",".join([ "0x00" for i in range(var_max_len-len(other_sku_other.default_value.split(",")))])
|
||||
tail = ",".join("0x00" for i in range(var_max_len-len(other_sku_other.default_value.split(","))))
|
||||
|
||||
others_data_buffer = VariableMgr.PACK_VARIABLES_DATA(other_sku_other.default_value,other_sku_other.data_type,tail)
|
||||
|
||||
|
Reference in New Issue
Block a user