Overview
| Artifact ID: | 1cc51195d0526aa9c8690da38dcb8508bf966ea0 |
|---|---|
| Ticket: | 428572ffffffffffffffffffffffffffffffffff
Tcl_DStringAppendElement speedup |
| User & Date: | nobody on 2001-05-30 07:04:45 |
Changes
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
This patch avoids a repeated strlen call by using the Counted versions of ScanElement and ConvertElement. Index: tclUtil.c ======================================================= ============ RCS file: /cvsroot/tcl/tcl/generic/tclUtil.c,v retrieving revision 1.18 diff -c -r1.18 tclUtil.c *** tclUtil.c 2000/05/08 21:59:59 1.18 --- tclUtil.c 2001/05/30 06:57:32 *************** *** 1452,1459 **** { int newSize, flags; char *dst; ! newSize = Tcl_ScanElement(string, &flags) + dsPtr->length + 1; /* * Allocate a larger buffer for the string if the current one isn't --- 1452,1461 ---- { int newSize, flags; char *dst; + int stringSize; ! stringSize = strlen (string); ! newSize = Tcl_ScanCountedElement(string, stringSize, &flags) + dsPtr->length + 1; /* * Allocate a larger buffer for the string if the current one isn't *************** *** 1490,1496 **** dst++; dsPtr->length++; } ! dsPtr->length += Tcl_ConvertElement(string, dst, flags); return dsPtr->string; } --- 1492,1498 ---- dst++; dsPtr->length++; } ! dsPtr->length += Tcl_ConvertCountedElement (string, stringSize, dst, flags); return dsPtr->string; } - foundin changed to: "None"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nobody"
- subsystem changed to: "11. Conversions from String"
- title changed to: "Tcl_DStringAppendElement speedup"
- type changed to: "Patch"