summaryrefslogtreecommitdiffstats
path: root/generic/tclUtil.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2011-04-18 18:50:41 (GMT)
committerdgp <dgp@users.sourceforge.net>2011-04-18 18:50:41 (GMT)
commit66a254dddfb0c618ee609c6bfab4a6549e098772 (patch)
tree8d78f56622c7353be617d046b3586a18a8ca4ae1 /generic/tclUtil.c
parent76259f2d58dc67f1a0095a1891696b69167c3902 (diff)
parent50920cb27bda1113bd1e4edf637f4a6d03c8d63a (diff)
downloadtcl-66a254dddfb0c618ee609c6bfab4a6549e098772.zip
tcl-66a254dddfb0c618ee609c6bfab4a6549e098772.tar.gz
tcl-66a254dddfb0c618ee609c6bfab4a6549e098772.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 4fe1015..f77320b 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -1204,19 +1204,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 = objPtr->internalRep.twoPtrValue.ptr1;
- if (objPtr->bytes != NULL && !listRepPtr->canonicalFlag) {
+ Tcl_GetStringFromObj(objPtr, &length);
+ if (length > 0) {
break;
}
}
@@ -1236,7 +1231,7 @@ Tcl_ConcatObj(
*/
objPtr = objv[i];
- if (objPtr->bytes && !objPtr->length) {
+ if (objPtr->bytes && objPtr->length == 0) {
continue;
}
TclListObjGetElements(NULL, objPtr, &listc, &listv);