diff options
author | dgp <dgp@users.sourceforge.net> | 2004-10-18 21:15:15 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2004-10-18 21:15:15 (GMT) |
commit | c1d97ce12a7418450665a45cf72e0e220fbf742e (patch) | |
tree | 15728b6d666ede40e4d63fa58ad35386c9728700 /generic/tclCmdAH.c | |
parent | c5e8b71d6e3be0bf8385db975f0f91a717cbd7e8 (diff) | |
download | tcl-c1d97ce12a7418450665a45cf72e0e220fbf742e.zip tcl-c1d97ce12a7418450665a45cf72e0e220fbf742e.tar.gz tcl-c1d97ce12a7418450665a45cf72e0e220fbf742e.tar.bz2 |
* generic/tclBasic.c (Tcl_CreateInterp,Tcl_DeleteInterp):
* generic/tclCmdAH.c (Tcl_CatchObjCmd):
* generic/tclCmdMZ.c (TclMergeReturnOptions,TclProcessReturn):
* generic/tclCompCmds.c (TclCompileReturnCmd):
* generic/tclExecute.c (TclCompEvalObj):
* generic/tclInt.h (Interp):
* generic/tclProc.c (TclUpdateReturnInfo):
Place primary storage of the -level and -code information in private
fields of the Interp struct, rather than in a DictObj. This should
significantly improve performance of TclUpdateReturnInfo.
Diffstat (limited to 'generic/tclCmdAH.c')
-rw-r--r-- | generic/tclCmdAH.c | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index 960b039..8d44139 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCmdAH.c,v 1.54 2004/10/15 04:01:28 dgp Exp $ + * RCS: @(#) $Id: tclCmdAH.c,v 1.55 2004/10/18 21:15:35 dgp Exp $ */ #include "tclInt.h" @@ -271,9 +271,13 @@ Tcl_CatchObjCmd(dummy, interp, objc, objv) if (objc == 4) { Interp *iPtr = (Interp *) interp; Tcl_Obj *options = Tcl_DuplicateObj(iPtr->returnOpts); - Tcl_Obj *value = NULL; - if (result != TCL_RETURN) { + if (result == TCL_RETURN) { + Tcl_DictObjPut(NULL, options, + iPtr->returnCodeKey, Tcl_NewIntObj(iPtr->returnCode)); + Tcl_DictObjPut(NULL, options, + iPtr->returnLevelKey, Tcl_NewIntObj(iPtr->returnLevel)); + } else { Tcl_DictObjPut(NULL, options, iPtr->returnCodeKey, Tcl_NewIntObj(result)); Tcl_DictObjPut(NULL, options, @@ -285,26 +289,12 @@ Tcl_CatchObjCmd(dummy, interp, objc, objv) * When result was an error, fill in any missing values * for -errorinfo, -errorcode, and -errorline */ - - value = NULL; - Tcl_DictObjGet(NULL, options, iPtr->returnErrorinfoKey, &value); - if (NULL == value) { - Tcl_DictObjPut(NULL, options, iPtr->returnErrorinfoKey, - iPtr->errorInfo); - } - - value = NULL; - Tcl_DictObjGet(NULL, options, iPtr->returnErrorcodeKey, &value); - if (NULL == value) { - Tcl_DictObjPut(NULL, options, iPtr->returnErrorcodeKey, - iPtr->errorCode); - } - value = NULL; - Tcl_DictObjGet(NULL, options, iPtr->returnErrorlineKey, &value); - if (NULL == value) { - Tcl_DictObjPut(NULL, options, iPtr->returnErrorlineKey, + Tcl_DictObjPut(NULL, options, + iPtr->returnErrorinfoKey, iPtr->errorInfo); + Tcl_DictObjPut(NULL, options, + iPtr->returnErrorcodeKey, iPtr->errorCode); + Tcl_DictObjPut(NULL, options, iPtr->returnErrorlineKey, Tcl_NewIntObj(iPtr->errorLine)); - } } if (NULL == |