Commit 8bb8e68a authored by Nicolas Dumazet's avatar Nicolas Dumazet

avoid a few unnecessary lookups


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32736 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0ad56e83
...@@ -684,15 +684,17 @@ class XMLMatrix(Folder): ...@@ -684,15 +684,17 @@ class XMLMatrix(Folder):
else: else:
# Check empty indices. # Check empty indices.
empty_list = [] empty_list = []
for i in self.index[base_id].keys(): base_item = self.index[base_id]
if self.index[base_id][i] is None or len(self.index[base_id][i]) == 0: for i in base_item.keys():
item = base_item[i]
if item is None or len(item) == 0:
addError("There is no id for the %dth axis of base_id %s" % (i, base_id)) addError("There is no id for the %dth axis of base_id %s" % (i, base_id))
empty_list.append(i) empty_list.append(i)
if fixit: if fixit:
for i in empty_list: for i in empty_list:
del self.index[base_id][i] del base_item[i]
len_id = len(self.index[base_id]) len_id = len(base_item)
if len(object_id_split) != (len_id + base_id_len): # +1 for the quantity if len(object_id_split) != (len_id + base_id_len): # +1 for the quantity
addError("Dimension of cell is %s but should be %s" % (len(object_id_split) addError("Dimension of cell is %s but should be %s" % (len(object_id_split)
- base_id_len, len_id)) - base_id_len, len_id))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment