diff options
author | dgp <dgp@users.sourceforge.net> | 2018-02-23 18:01:26 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2018-02-23 18:01:26 (GMT) |
commit | a9e916f1b99088ecc8185ace75245d6801aebaf6 (patch) | |
tree | 19be952cac68a19fce1cb3dd961d2dc5ca56977b /generic/tclUtil.c | |
parent | c908681186e6c76d5479749ed6ca70b458d093fd (diff) | |
parent | 6faf2feff2aa8ca778eccc29cb8c43c14ea6199d (diff) | |
download | tcl-a9e916f1b99088ecc8185ace75245d6801aebaf6.zip tcl-a9e916f1b99088ecc8185ace75245d6801aebaf6.tar.gz tcl-a9e916f1b99088ecc8185ace75245d6801aebaf6.tar.bz2 |
merge 8.7
Diffstat (limited to 'generic/tclUtil.c')
-rw-r--r-- | generic/tclUtil.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c index 0605055..546e9f3 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -118,8 +118,11 @@ static int FindElement(Tcl_Interp *interp, const char *string, /* * The following is the Tcl object type definition for an object that * represents a list index in the form, "end-offset". It is used as a - * performance optimization in TclGetIntForIndex. The internal rep is an - * integer, so no memory management is required for it. + * performance optimization in TclGetIntForIndex. The internal rep is + * stored directly in the wideValue, so no memory management is required + * for it. This is a caching intrep, keeping the result of a parse + * around. This type is only created from a pre-existing string, so an + * updateStringProc will never be called and need not exist. */ static const Tcl_ObjType endOffsetType = { @@ -2529,7 +2532,8 @@ TclStringMatchObj( udata = Tcl_GetUnicodeFromObj(strObj, &length); uptn = Tcl_GetUnicodeFromObj(ptnObj, &plen); match = TclUniCharMatch(udata, length, uptn, plen, flags); - } else if (TclIsPureByteArray(strObj) && !flags) { + } else if (TclIsPureByteArray(strObj) && TclIsPureByteArray(ptnObj) + && !flags) { unsigned char *data, *ptn; data = Tcl_GetByteArrayFromObj(strObj, &length); @@ -3692,8 +3696,6 @@ GetEndOffsetFromObj( Tcl_StoreIntRep(objPtr, &endOffsetType, &ir); } - - *indexPtr = endValue + (int)irPtr->wideValue; return TCL_OK; } |