[Erp5-report] r35589 nicolas.dumazet - /erp5/trunk/products/ERP5Type/CopySupport.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue May 25 04:15:27 CEST 2010
Author: nicolas.dumazet
Date: Tue May 25 04:15:25 2010
New Revision: 35589
URL: http://svn.erp5.org?rev=35589&view=rev
Log:
We do not need to split the complete path and can save a few cycles here
Modified:
erp5/trunk/products/ERP5Type/CopySupport.py
Modified: erp5/trunk/products/ERP5Type/CopySupport.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/CopySupport.py?rev=35589&r1=35588&r2=35589&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/CopySupport.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/CopySupport.py [utf8] Tue May 25 04:15:25 2010
@@ -116,8 +116,9 @@
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
More information about the Erp5-report
mailing list