[Python-checkins] r84283 - python/branches/py3k/Objects/listobject.c

benjamin.peterson python-checkins at python.org
Mon Aug 23 21:35:39 CEST 2010


Author: benjamin.peterson
Date: Mon Aug 23 21:35:39 2010
New Revision: 84283

Log:
reorder and save a comparison

Modified:
   python/branches/py3k/Objects/listobject.c

Modified: python/branches/py3k/Objects/listobject.c
==============================================================================
--- python/branches/py3k/Objects/listobject.c	(original)
+++ python/branches/py3k/Objects/listobject.c	Mon Aug 23 21:35:39 2010
@@ -1934,17 +1934,17 @@
         }
     }
 
-    /* Reverse sort stability achieved by initially reversing the list,
-    applying a stable forward sort, then reversing the final result. */
-    if (reverse && saved_ob_size > 1)
-        reverse_slice(saved_ob_item, saved_ob_item + saved_ob_size);
-
     merge_init(&ms);
 
     nremaining = saved_ob_size;
     if (nremaining < 2)
         goto succeed;
 
+    /* Reverse sort stability achieved by initially reversing the list,
+    applying a stable forward sort, then reversing the final result. */
+    if (reverse)
+        reverse_slice(saved_ob_item, saved_ob_item + saved_ob_size);
+
     /* March over the array once, left to right, finding natural runs,
      * and extending short natural runs to minrun elements.
      */


More information about the Python-checkins mailing list