summaryrefslogtreecommitdiffstats
path: root/generic/tclUtil.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2011-04-18 18:31:18 (GMT)
committerdgp <dgp@users.sourceforge.net>2011-04-18 18:31:18 (GMT)
commit50920cb27bda1113bd1e4edf637f4a6d03c8d63a (patch)
treee3a65c3f98e799650f4c4afb7abef6c94662c81e /generic/tclUtil.c
parentae1e62908f477136ea8d2d65e1c4b8603bccbd05 (diff)
downloadtcl-50920cb27bda1113bd1e4edf637f4a6d03c8d63a.zip
tcl-50920cb27bda1113bd1e4edf637f4a6d03c8d63a.tar.gz
tcl-50920cb27bda1113bd1e4edf637f4a6d03c8d63a.tar.bz2
Define and use macros that test whether a Tcl list value is canonical.
Diffstat (limited to 'generic/tclUtil.c')
-rw-r--r--generic/tclUtil.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index 44a24f8..b3e1e08 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -1196,19 +1196,14 @@ Tcl_ConcatObj(
*/
for (i = 0; i < objc; i++) {
- List *listRepPtr;
+ int length;
objPtr = objv[i];
- if (objPtr->typePtr != &tclListType) {
- TclGetString(objPtr);
- if (objPtr->length) {
- break;
- } else {
- continue;
- }
+ if (TclListObjIsCanonical(objPtr)) {
+ continue;
}
- listRepPtr = (List *) objPtr->internalRep.twoPtrValue.ptr1;
- if (objPtr->bytes != NULL && !listRepPtr->canonicalFlag) {
+ Tcl_GetStringFromObj(objPtr, &length);
+ if (length > 0) {
break;
}
}
@@ -1228,7 +1223,7 @@ Tcl_ConcatObj(
*/
objPtr = objv[i];
- if (objPtr->bytes && !objPtr->length) {
+ if (objPtr->bytes && objPtr->length == 0) {
continue;
}
TclListObjGetElements(NULL, objPtr, &listc, &listv);