summaryrefslogtreecommitdiffstats
path: root/BaseTools
diff options
context:
space:
mode:
authorCarsey, Jaben <jaben.carsey@intel.com>2018-04-28 06:32:42 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2018-05-04 13:03:10 +0800
commit1549328f5f48c657137c3ead96f2ad3586713a33 (patch)
tree443452e6830a1361d3e6b1b9a9c2eada2ed4ed70 /BaseTools
parentd3054be59ef0a4b007064c9d7844c1fbeed4443f (diff)
downloadedk2-1549328f5f48c657137c3ead96f2ad3586713a33.tar.gz
edk2-1549328f5f48c657137c3ead96f2ad3586713a33.tar.bz2
edk2-1549328f5f48c657137c3ead96f2ad3586713a33.zip
BaseTools: AutoGen - refactor function to remove extra variables
we dont need to keep data we already have in different formats... 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>
Diffstat (limited to 'BaseTools')
-rw-r--r--BaseTools/Source/Python/AutoGen/GenVar.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/BaseTools/Source/Python/AutoGen/GenVar.py b/BaseTools/Source/Python/AutoGen/GenVar.py
index 4f894f3f73..e3595bb623 100644
--- a/BaseTools/Source/Python/AutoGen/GenVar.py
+++ b/BaseTools/Source/Python/AutoGen/GenVar.py
@@ -110,17 +110,14 @@ class VariableMgr(object):
@staticmethod
def assemble_variable(valuedict):
- ordered_offset = sorted(valuedict.keys())
- ordered_value = [valuedict[k] for k in ordered_offset]
+ ordered_valuedict_keys = sorted(valuedict.keys())
var_value = []
- num = 0
- for offset in ordered_offset:
- if offset < len(var_value):
+ for current_valuedict_key in ordered_valuedict_keys:
+ if current_valuedict_key < len(var_value):
raise
- for _ in xrange(offset - len(var_value)):
+ for _ in xrange(current_valuedict_key - len(var_value)):
var_value.append('0x00')
- var_value += ordered_value[num]
- num +=1
+ var_value += valuedict[current_valuedict_key]
return var_value
def process_variable_data(self):