From dea5ef9dc41c5d7a1a6b20a9457433faf92cc623 Mon Sep 17 00:00:00 2001 From: "Carsey, Jaben" Date: Sat, 28 Apr 2018 06:32:19 +0800 Subject: [PATCH] BaseTools: AutoGen - refactor assemble_variable make this function @staticmethod since self parameter is not used. change valuelist to valuedict since it is a dictionary. 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/AutoGen/GenVar.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/GenVar.py b/BaseTools/Source/Python/AutoGen/GenVar.py index 13bcf99b26..b8f40da9a3 100644 --- a/BaseTools/Source/Python/AutoGen/GenVar.py +++ b/BaseTools/Source/Python/AutoGen/GenVar.py @@ -113,9 +113,10 @@ class VariableMgr(object): 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()] - def assemble_variable(self, valuelist): - ordered_offset = sorted(valuelist.keys()) - ordered_value = [valuelist[k] for k in ordered_offset] + @staticmethod + def assemble_variable(valuedict): + ordered_offset = sorted(valuedict.keys()) + ordered_value = [valuedict[k] for k in ordered_offset] var_value = [] num = 0 for offset in ordered_offset: @@ -126,6 +127,7 @@ class VariableMgr(object): var_value += ordered_value[num] num +=1 return var_value + def process_variable_data(self): var_data = collections.defaultdict(collections.OrderedDict)