diff options
author | dgp <dgp@noemail.net> | 2011-04-18 18:50:41 (GMT) |
---|---|---|
committer | dgp <dgp@noemail.net> | 2011-04-18 18:50:41 (GMT) |
commit | b82093c05dfdef1b0495d2302dd6cbef726f5f10 (patch) | |
tree | 8d78f56622c7353be617d046b3586a18a8ca4ae1 /generic/tclUtil.c | |
parent | b9e223437ec3cddc8b6dbdaf83f7972c5c0cf45d (diff) | |
parent | 85569bece28a67fb36aa388e7940ab94283ff653 (diff) | |
download | tcl-b82093c05dfdef1b0495d2302dd6cbef726f5f10.zip tcl-b82093c05dfdef1b0495d2302dd6cbef726f5f10.tar.gz tcl-b82093c05dfdef1b0495d2302dd6cbef726f5f10.tar.bz2 |
Define and use macros that test whether a Tcl list value is canonical.
FossilOrigin-Name: 4b0bb72cb337b8f2ca6bd99b43d8cd9b72f703ad
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 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); |