Commit 2e40bf71 authored by Nicolas Dumazet's avatar Nicolas Dumazet

We do not need to split the complete path and can save a few cycles here


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35589 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 720a5df4
......@@ -116,8 +116,9 @@ class CopyContainer:
category_list = object.getCategoryList()
path_len = len(path_item_list)
for position in xrange(len(category_list)):
category_name = category_list[position].split('/')
if category_name[1:path_len + 1] == path_item_list: # XXX Should be possible to do this in a cleaner way
# only need to compare the first path_len components after the portal
category_name = category_list[position].split('/', path_len+1)
if category_name[1:path_len + 1] == path_item_list:
category_name[path_len] = new_id
category_list[position] = '/'.join(category_name)
changed = True
......
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