diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-03-21 13:55:11 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-03-21 13:55:11 (GMT) |
commit | 29080aaa9aa4b3a25eed62b35a8703324e4b652c (patch) | |
tree | 5c51da27a8473c687ab32cca8029ca2dc98d3af7 /generic/tclArithSeries.c | |
parent | be7f5c536c48c876701cfeee5085e12aa9cdc649 (diff) | |
parent | 3fd7f1aa143d5095721daf36be1497966e1fae79 (diff) | |
download | tcl-29080aaa9aa4b3a25eed62b35a8703324e4b652c.zip tcl-29080aaa9aa4b3a25eed62b35a8703324e4b652c.tar.gz tcl-29080aaa9aa4b3a25eed62b35a8703324e4b652c.tar.bz2 |
Merge 8.7. Tcl_GetStringFromObj() -> TclGetStringFromObj() (optimization)
Diffstat (limited to 'generic/tclArithSeries.c')
-rwxr-xr-x | generic/tclArithSeries.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/generic/tclArithSeries.c b/generic/tclArithSeries.c index 50c8b13..5f10603 100755 --- a/generic/tclArithSeries.c +++ b/generic/tclArithSeries.c @@ -919,7 +919,7 @@ TclArithSeriesGetElements( *objcPtr = objc; } else { if (interp != NULL) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf("value is not an arithseries")); + Tcl_SetObjResult(interp, Tcl_NewStringObj("value is not an arithseries", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "UNKNOWN", (void *)NULL); } return TCL_ERROR; @@ -1104,7 +1104,7 @@ UpdateStringOfArithSeries(Tcl_Obj *arithSeriesObjPtr) for (i = 0; i < arithSeriesRepPtr->len; i++) { if (TclArithSeriesObjIndex(NULL, arithSeriesObjPtr, i, &eleObj) == TCL_OK) { Tcl_Size slen; - char *str = Tcl_GetStringFromObj(eleObj, &slen); + char *str = TclGetStringFromObj(eleObj, &slen); strcpy(p, str); p[slen] = ' '; p += slen + 1; @@ -1157,13 +1157,13 @@ ArithSeriesInOperation( if (status != TCL_OK) { test = 0; } else { - const char *vstr = Tcl_GetStringFromObj(valueObj, &vlen); + const char *vstr = TclGetStringFromObj(valueObj, &vlen); index = (y - dblRepPtr->start) / dblRepPtr->step; while (incr<2) { Tcl_Obj *elemObj; elen = 0; TclArithSeriesObjIndex(interp, arithSeriesObjPtr, (index+incr), &elemObj); - const char *estr = elemObj ? Tcl_GetStringFromObj(elemObj, &elen) : ""; + const char *estr = elemObj ? TclGetStringFromObj(elemObj, &elen) : ""; /* "in" operation defined as a string compare */ test = (elen == vlen) ? (memcmp(estr, vstr, elen) == 0) : 0; Tcl_BounceRefCount(elemObj); @@ -1191,8 +1191,8 @@ ArithSeriesInOperation( elen = 0; index = (y - intRepPtr->start) / intRepPtr->step; TclArithSeriesObjIndex(interp, arithSeriesObjPtr, index, &elemObj); - char const *vstr = Tcl_GetStringFromObj(valueObj, &vlen); - char const *estr = elemObj ? Tcl_GetStringFromObj(elemObj, &elen) : ""; + char const *vstr = TclGetStringFromObj(valueObj, &vlen); + char const *estr = elemObj ? TclGetStringFromObj(elemObj, &elen) : ""; if (boolResult) { *boolResult = (elen == vlen) ? (memcmp(estr, vstr, elen) == 0) : 0; } |