]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: AutoGen - refactor function to remove extra variables
authorCarsey, Jaben <jaben.carsey@intel.com>
Fri, 27 Apr 2018 22:32:42 +0000 (06:32 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Fri, 4 May 2018 05:03:10 +0000 (13:03 +0800)
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>
BaseTools/Source/Python/AutoGen/GenVar.py

index 4f894f3f73f35e72cb4af9f1665d6bbcf6ae7648..e3595bb6231547690cc9bb4613e5e7b6b2a4382c 100644 (file)
@@ -110,17 +110,14 @@ class VariableMgr(object):
 \r
     @staticmethod\r
     def assemble_variable(valuedict):\r
-        ordered_offset = sorted(valuedict.keys())\r
-        ordered_value = [valuedict[k] for k in ordered_offset]\r
+        ordered_valuedict_keys = sorted(valuedict.keys())\r
         var_value = []\r
-        num = 0\r
-        for offset in ordered_offset:\r
-            if offset < len(var_value):\r
+        for current_valuedict_key in ordered_valuedict_keys:\r
+            if current_valuedict_key < len(var_value):\r
                 raise\r
-            for _ in xrange(offset - len(var_value)):\r
+            for _ in xrange(current_valuedict_key - len(var_value)):\r
                 var_value.append('0x00')\r
-            var_value += ordered_value[num]\r
-            num +=1\r
+            var_value += valuedict[current_valuedict_key]\r
         return var_value\r
 \r
     def process_variable_data(self):\r