summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorhobbs <hobbs>2002-02-27 06:38:39 (GMT)
committerhobbs <hobbs>2002-02-27 06:38:39 (GMT)
commitb599dccc0f6806bcd8ec702b3c9912d6a571c2b0 (patch)
tree8d7d5c251d9e03d7eb1ae7c792c20f09ebcfcbf1 /generic
parentc860eaf039b4d9082d25adf5218b84330583fa14 (diff)
downloadtcl-b599dccc0f6806bcd8ec702b3c9912d6a571c2b0.zip
tcl-b599dccc0f6806bcd8ec702b3c9912d6a571c2b0.tar.gz
tcl-b599dccc0f6806bcd8ec702b3c9912d6a571c2b0.tar.bz2
* generic/tclVar.c (Tcl_ArrayObjCmd): removed extra obj allocation.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclVar.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/generic/tclVar.c b/generic/tclVar.c
index b850878..7a8741a 100644
--- a/generic/tclVar.c
+++ b/generic/tclVar.c
@@ -15,7 +15,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclVar.c,v 1.48 2002/02/15 14:28:49 dkf Exp $
+ * RCS: @(#) $Id: tclVar.c,v 1.49 2002/02/27 06:38:39 hobbs Exp $
*/
#include "tclInt.h"
@@ -3414,18 +3414,18 @@ Tcl_ArrayObjCmd(dummy, interp, objc, objv)
*/
varPtr->refCount++;
- tmpResPtr = Tcl_NewObj();
/*
* Get the array values corresponding to each element name
*/
- result = Tcl_ListObjGetElements(interp, nameLstPtr, &count, &namePtrPtr);
+ tmpResPtr = Tcl_NewObj();
+ result = Tcl_ListObjGetElements(interp, nameLstPtr,
+ &count, &namePtrPtr);
if (result != TCL_OK) {
goto errorInArrayGet;
}
- tmpResPtr = Tcl_NewObj();
for (i = 0; i < count; i++) {
namePtr = *namePtrPtr++;
valuePtr = Tcl_ObjGetVar2(interp, objv[2], namePtr,
@@ -3439,8 +3439,8 @@ Tcl_ArrayObjCmd(dummy, interp, objc, objv)
if (TclIsVarArray(varPtr) && !TclIsVarUndefined(varPtr)) {
/*
- * The array itself looks OK, the variable was undefined:
- * forget it.
+ * The array itself looks OK, the variable was
+ * undefined: forget it.
*/
continue;
@@ -3449,13 +3449,11 @@ Tcl_ArrayObjCmd(dummy, interp, objc, objv)
goto errorInArrayGet;
}
}
- result = Tcl_ListObjAppendElement(interp, tmpResPtr,
- namePtr);
+ result = Tcl_ListObjAppendElement(interp, tmpResPtr, namePtr);
if (result != TCL_OK) {
goto errorInArrayGet;
}
- result = Tcl_ListObjAppendElement(interp, tmpResPtr,
- valuePtr);
+ result = Tcl_ListObjAppendElement(interp, tmpResPtr, valuePtr);
if (result != TCL_OK) {
goto errorInArrayGet;
}