summaryrefslogtreecommitdiffstats
path: root/generic/tclFCmd.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2007-09-17 10:43:58 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2007-09-17 10:43:58 (GMT)
commit3c73dfe8f910b0af223198e6f8196f6bc52124f6 (patch)
treed76e0f74a90f608998352567ac610785f244c7dc /generic/tclFCmd.c
parent700619fa04b8a0e355f2716eb6fe90d71303b4f9 (diff)
downloadtcl-3c73dfe8f910b0af223198e6f8196f6bc52124f6.zip
tcl-3c73dfe8f910b0af223198e6f8196f6bc52124f6.tar.gz
tcl-3c73dfe8f910b0af223198e6f8196f6bc52124f6.tar.bz2
Generate literal values more efficiently using TclNewLiteralStringObj macro.
Diffstat (limited to 'generic/tclFCmd.c')
-rw-r--r--generic/tclFCmd.c18
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);