[Erp5-report] r23852 - in /erp5/trunk/products/ERP5/bootstrap/erp5_core: SkinTemplateItem/p...

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Sep 26 23:22:06 CEST 2008


Author: kazuhiko
Date: Fri Sep 26 23:22:05 2008
New Revision: 23852

URL: http://svn.erp5.org?rev=23852&view=rev
Log:
use sort(key=) instead of sort(cmp=) for better performance.

Modified:
    erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Category_getSortedCategoryChildValueList.xml
    erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_getModuleItemList.xml
    erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ListBox_initializeFastInput.xml
    erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/RamCache_getCachePluginStatisticList.xml
    erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Category_getSortedCategoryChildValueList.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Category_getSortedCategoryChildValueList.xml?rev=23852&r1=23851&r2=23852&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Category_getSortedCategoryChildValueList.xml (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Category_getSortedCategoryChildValueList.xml Fri Sep 26 23:22:05 2008
@@ -59,7 +59,7 @@
 \n
 value_list = filter(lambda o: o.getRelativeUrl() != context.getRelativeUrl(),context.getCategoryChildValueList())\n
 sort_id=\'int_index\'\n
-value_list.sort(lambda x,y: cmp(x.getProperty(sort_id), y.getProperty(sort_id)))\n
+value_list.sort(key=lambda x: x.getProperty(sort_id))\n
 return value_list\n
 </string> </value>
         </item>

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_getModuleItemList.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_getModuleItemList.xml?rev=23852&r1=23851&r2=23852&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_getModuleItemList.xml (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_getModuleItemList.xml Fri Sep 26 23:22:05 2008
@@ -68,7 +68,7 @@
       if portal.portal_membership.checkPermission(\'View\', module):\n
         item_list.append((gettext(module.getTitleOrId()), module.absolute_url_path()))\n
 \n
-  item_list.sort(lambda a, b:cmp(a[0], b[0]))\n
+  item_list.sort(key=lambda x: x[0])\n
   return item_list\n
 \n
 getModuleItemList = CachingMethod(getModuleItemList,  \n

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ListBox_initializeFastInput.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ListBox_initializeFastInput.xml?rev=23852&r1=23851&r2=23852&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ListBox_initializeFastInput.xml (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ListBox_initializeFastInput.xml Fri Sep 26 23:22:05 2008
@@ -76,7 +76,7 @@
   keys_list = listbox.keys()\n
 \n
   if keys_list != []:\n
-    keys_list.sort(lambda x,y: cmp(int(x),int(y)))\n
+    keys_list.sort(key=lambda x: int(x))\n
     first_empty_line_id = int(keys_list[-1])+1\n
 \n
   for i in keys_list:\n

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/RamCache_getCachePluginStatisticList.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/RamCache_getCachePluginStatisticList.xml?rev=23852&r1=23851&r2=23852&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/RamCache_getCachePluginStatisticList.xml (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/RamCache_getCachePluginStatisticList.xml Fri Sep 26 23:22:05 2008
@@ -85,7 +85,7 @@
 # sort result\n
 if kw.get(\'sort_on\', None) is not None:\n
   sort_on_attr, sort_on_order = kw[\'sort_on\'][0]\n
-  result.sort(lambda x,y: cmp(int(getattr(x, sort_on_attr)), int(getattr(y, sort_on_attr))))\n
+  result.sort(key=lambda x: int(getattr(x, sort_on_attr)))\n
   if sort_on_order == \'descending\':\n
     result.reverse()\n
 \n

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision?rev=23852&r1=23851&r2=23852&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision Fri Sep 26 23:22:05 2008
@@ -1,1 +1,1 @@
-968
+969




More information about the Erp5-report mailing list