Commit 544fcdb2 authored by Vincent Pelletier's avatar Vincent Pelletier

Use iteritems to get rid of some property & key lookups.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18548 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 53cb9c2d
......@@ -204,17 +204,15 @@ class XMLMatrix(Folder):
if self.index.has_key(base_id):
# Look at each dimension i of the previous index
for i in self.index[base_id].keys():
for i, i_value in self.index[base_id].iteritems():
# If the new index has the same dimensionality
# Look at new location of cells
if new_index.has_key(i):
temp = {}
# Look at each index in a given dimension i
for my_id in self.index[base_id][i].keys():
new_place = new_index[i].get(my_id)
old_place = self.index[base_id][i][my_id]
for my_id, my_value in i_value.iteritems():
# create a movement in dimension i between old_place and new_place
temp[old_place] = new_place
temp[my_value] = new_index[i].get(my_id)
movement[i] = temp
# Rename every 'object_id' by 'temp_object_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