summaryrefslogtreecommitdiffstats
path: root/generic/tclUtil.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2005-09-06 14:40:10 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2005-09-06 14:40:10 (GMT)
commit2a03bdad453a632583f84f71bf5091c682999d90 (patch)
treeee5ecb28aed27dfd77a3aaad1ce38dba487777c1 /generic/tclUtil.c
parent6933a16b87680a7df40757d369a9a6d6a6f333de (diff)
downloadtcl-2a03bdad453a632583f84f71bf5091c682999d90.zip
tcl-2a03bdad453a632583f84f71bf5091c682999d90.tar.gz
tcl-2a03bdad453a632583f84f71bf5091c682999d90.tar.bz2
Add flag to lists so that evaluating contexts can handle them efficiently much
of the time even when they are not pure. The flag works by keeping track of when the string rep was derived from the internal rep.
Diffstat (limited to 'generic/tclUtil.c')
-rw-r--r--generic/tclUtil.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index 30cf775..0654f65 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclUtil.c,v 1.63 2005/07/27 18:24:02 dgp Exp $
+ * RCS: @(#) $Id: tclUtil.c,v 1.64 2005/09/06 14:40:11 dkf Exp $
*/
#include "tclInt.h"
@@ -1057,8 +1057,14 @@ Tcl_ConcatObj(objc, objv)
*/
for (i = 0; i < objc; i++) {
+ List *listRepPtr;
+
objPtr = objv[i];
- if ((objPtr->typePtr != &tclListType) || (objPtr->bytes != NULL)) {
+ if (objPtr->typePtr != &tclListType) {
+ break;
+ }
+ listRepPtr = (List *) objPtr->internalRep.twoPtrValue.ptr1;
+ if (objPtr->bytes != NULL && !listRepPtr->canonicalFlag) {
break;
}
}
@@ -1074,6 +1080,7 @@ Tcl_ConcatObj(objc, objv)
* INT_MAX tells us to always put the new stuff on the end. It
* will be set right in Tcl_ListObjReplace.
*/
+
Tcl_ListObjGetElements(NULL, objv[i], &listc, &listv);
Tcl_ListObjReplace(NULL, objPtr, INT_MAX, 0, listc, listv);
}