summaryrefslogtreecommitdiffstats
path: root/generic
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 /generic
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.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclCmdIL.c4
1 files changed, 2 insertions, 2 deletions
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){