diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2007-12-22 00:58:20 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2007-12-22 00:58:20 (GMT) |
commit | be3803aca6bc4d8286f24850bffc9937cfd520bb (patch) | |
tree | 388ab37a21dc4a8274c8947e249f6d4210f0ec26 | |
parent | a2c8a724a6ca513a8ae8628fe27ec313d6828e00 (diff) | |
download | tcl-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-- | ChangeLog | 5 | ||||
-rw-r--r-- | generic/tclCmdIL.c | 4 |
2 files changed, 7 insertions, 2 deletions
@@ -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){ |