Overview
| Artifact ID: | 8d14c5cbe61741e946ab3e753eddeabb9502b610 |
|---|---|
| Ticket: | 1310081fffffffffffffffffffffffffffffffff
Tcl_GetWideIntFromObj optimization |
| User & Date: | muonics on 2005-10-01 07:27:46 |
Changes
- assignee changed to: "msofer"
- cmimetype changed to: "text/plain"
- comment changed to:
Tcl_GetWideIntFromObj() appears to go through the string representation for all but tclWideIntType -- even for tclIntType. Tcl_GetIntFromObj() is optimized to deal with the internal representation already being tclWideIntType; seems a simple fix to optimize Tcl_GetWideIntFromObj() given that the wide int should be at least as (if not more) wide as a long. Index: tclObj.c =================================================================== RCS file: /home/CVSROOT/tcl/generic/tclObj.c,v retrieving revision 1.1.1.4 diff -u -p -r1.1.1.4 tclObj.c --- tclObj.c 23 May 2005 06:35:06 -0000 1.1.1.4 +++ tclObj.c 1 Oct 2005 07:09:29 -0000 @@ -2586,6 +2586,10 @@ Tcl_GetWideIntFromObj(interp, objPtr, wi *wideIntPtr = objPtr->internalRep.wideValue; return TCL_OK; } + if (objPtr->typePtr == &tclIntType) { + *wideIntPtr = objPtr->internalRep.longValue; + return TCL_OK; + } result = SetWideIntFromAny(interp, objPtr); if (result == TCL_OK) { *wideIntPtr = objPtr->internalRep.wideValue; (diffs are versus my local repository and 8.4.9, so version number's off versus SF CVS, but it should be obvious.) - foundin changed to: "obsolete: 8.4.11"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "muonics"
- subsystem changed to: "10. Objects"
- title changed to: "Tcl_GetWideIntFromObj optimization"
- type changed to: "Bug"