summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2007-12-22 00:58:20 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2007-12-22 00:58:20 (GMT)
commitbe3803aca6bc4d8286f24850bffc9937cfd520bb (patch)
tree388ab37a21dc4a8274c8947e249f6d4210f0ec26
parenta2c8a724a6ca513a8ae8628fe27ec313d6828e00 (diff)
downloadtcl-be3803aca6bc4d8286f24850bffc9937cfd520bb.zip
tcl-be3803aca6bc4d8286f24850bffc9937cfd520bb.tar.gz
tcl-be3803aca6bc4d8286f24850bffc9937cfd520bb.tar.bz2
* generic/tclCmdIL.c (Tcl_LsortObjCmd): preallocate a listObj of
sufficient length for the sorted list instead of growing it.
-rw-r--r--ChangeLog5
-rw-r--r--generic/tclCmdIL.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 8ae83c5..ab38ebc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-12-21 Miguel Sofer <msofer@users.sf.net>
+
+ * generic/tclCmdIL.c (Tcl_LsortObjCmd): preallocate a listObj of
+ sufficient length for the sorted list instead of growing it.
+
2007-12-19 Don Porter <dgp@users.sourceforge.net>
*** 8.5.0 TAGGED FOR RELEASE ***
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c
index ae5b3af..cd89ec3 100644
--- a/generic/tclCmdIL.c
+++ b/generic/tclCmdIL.c
@@ -16,7 +16,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCmdIL.c,v 1.129 2007/12/13 15:23:15 dgp Exp $
+ * RCS: @(#) $Id: tclCmdIL.c,v 1.130 2007/12/22 00:58:21 msofer Exp $
*/
#include "tclInt.h"
@@ -3605,7 +3605,7 @@ Tcl_LsortObjCmd(
elementArray[length-1].nextPtr = NULL;
elementPtr = MergeSort(elementArray, &sortInfo);
if (sortInfo.resultCode == TCL_OK) {
- resultPtr = Tcl_NewObj();
+ resultPtr = Tcl_NewListObj(length, NULL);
if (unique) {
if (indices) {
for (; elementPtr != NULL ; elementPtr = elementPtr->nextPtr){