[edk2] [PATCH v1 22/42] BaseTools: AutoGen - no need to recompute

Jaben Carsey posted 42 patches 7 years, 9 months ago
[edk2] [PATCH v1 22/42] BaseTools: AutoGen - no need to recompute
Posted by Jaben Carsey 7 years, 9 months ago
looping over a list and recomputing the same value has no impact on final value

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>
---
 BaseTools/Source/Python/AutoGen/GenPcdDb.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/GenPcdDb.py b/BaseTools/Source/Python/AutoGen/GenPcdDb.py
index f816ccaae311..70c7db7ca7c4 100644
--- a/BaseTools/Source/Python/AutoGen/GenPcdDb.py
+++ b/BaseTools/Source/Python/AutoGen/GenPcdDb.py
@@ -301,8 +301,7 @@ class DbItemList:
             for ItemIndex in xrange(Index):
                 Offset += len(self.RawDataList[ItemIndex])
         else:
-            for Datas in self.RawDataList:
-                Offset = self.ItemSize * Index
+            Offset = self.ItemSize * Index
 
         return Offset
 
-- 
2.16.2.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel