diff options
author | dgp <dgp@noemail.net> | 2011-04-18 18:31:18 (GMT) |
---|---|---|
committer | dgp <dgp@noemail.net> | 2011-04-18 18:31:18 (GMT) |
commit | 85569bece28a67fb36aa388e7940ab94283ff653 (patch) | |
tree | e3a65c3f98e799650f4c4afb7abef6c94662c81e /generic/tclUtil.c | |
parent | be49ba9beac70f6e9e1b38aa9257a15b5a0a97f0 (diff) | |
download | tcl-85569bece28a67fb36aa388e7940ab94283ff653.zip tcl-85569bece28a67fb36aa388e7940ab94283ff653.tar.gz tcl-85569bece28a67fb36aa388e7940ab94283ff653.tar.bz2 |
Define and use macros that test whether a Tcl list value is canonical.
FossilOrigin-Name: 13ac6c8c7b55fc9a2bdfb05efdca85459a613ef6
Diffstat (limited to 'generic/tclUtil.c')
-rw-r--r-- | generic/tclUtil.c | 17 |
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); |