diff options
author | dkf <dkf@noemail.net> | 2007-09-17 10:43:58 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2007-09-17 10:43:58 (GMT) |
commit | 902fcbbbbd5aa7a328fa614dc407f5952ce520a1 (patch) | |
tree | d76e0f74a90f608998352567ac610785f244c7dc /generic/tclFCmd.c | |
parent | 64af17533f7fdbe92e7f72a799ce4a3c44db5c60 (diff) | |
download | tcl-902fcbbbbd5aa7a328fa614dc407f5952ce520a1.zip tcl-902fcbbbbd5aa7a328fa614dc407f5952ce520a1.tar.gz tcl-902fcbbbbd5aa7a328fa614dc407f5952ce520a1.tar.bz2 |
Generate literal values more efficiently using TclNewLiteralStringObj macro.
FossilOrigin-Name: 9c077526f1cfc6e23453cdcb65def42278b3b6b6
Diffstat (limited to 'generic/tclFCmd.c')
-rw-r--r-- | generic/tclFCmd.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/generic/tclFCmd.c b/generic/tclFCmd.c index a9c1613..0d6db51 100644 --- a/generic/tclFCmd.c +++ b/generic/tclFCmd.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclFCmd.c,v 1.41 2007/06/28 21:10:38 patthoyts Exp $ + * RCS: @(#) $Id: tclFCmd.c,v 1.42 2007/09/17 10:44:04 dkf Exp $ */ #include "tclInt.h" @@ -694,20 +694,20 @@ CopyRenameOneFile( * cross-filesystem copy. We do this through our Tcl library. */ - Tcl_Obj *copyCommand = Tcl_NewListObj(0, NULL); + Tcl_Obj *copyCommand, *cmdObj, *opObj; - Tcl_IncrRefCount(copyCommand); - Tcl_ListObjAppendElement(interp, copyCommand, - Tcl_NewStringObj("::tcl::CopyDirectory",-1)); + TclNewObj(copyCommand); + TclNewLiteralStringObj(cmdObj, "::tcl::CopyDirectory"); + Tcl_ListObjAppendElement(interp, copyCommand, cmdObj); if (copyFlag) { - Tcl_ListObjAppendElement(interp, copyCommand, - Tcl_NewStringObj("copying",-1)); + TclNewLiteralStringObj(opObj, "copying"); } else { - Tcl_ListObjAppendElement(interp, copyCommand, - Tcl_NewStringObj("renaming",-1)); + TclNewLiteralStringObj(opObj, "renaming"); } + Tcl_ListObjAppendElement(interp, copyCommand, opObj); Tcl_ListObjAppendElement(interp, copyCommand, source); Tcl_ListObjAppendElement(interp, copyCommand, target); + Tcl_IncrRefCount(copyCommand); result = Tcl_EvalObjEx(interp, copyCommand, TCL_EVAL_GLOBAL | TCL_EVAL_DIRECT); Tcl_DecrRefCount(copyCommand); |