diff options
author | dgp <dgp@users.sourceforge.net> | 2018-04-18 21:03:53 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2018-04-18 21:03:53 (GMT) |
commit | 08c1a8dd343c7b9f2f21daf4b03894a3d28e1c47 (patch) | |
tree | 68b4e7dbbdeb61acf963211683ab3631d70f021f /generic | |
parent | fb91d4b68b081abb8ff689ed624a567c1a27a260 (diff) | |
download | tcl-08c1a8dd343c7b9f2f21daf4b03894a3d28e1c47.zip tcl-08c1a8dd343c7b9f2f21daf4b03894a3d28e1c47.tar.gz tcl-08c1a8dd343c7b9f2f21daf4b03894a3d28e1c47.tar.bz2 |
cleanup of refactor
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclVar.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/generic/tclVar.c b/generic/tclVar.c index a4cd62b..d954f0a 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -3142,7 +3142,6 @@ ArrayStartSearchCmd( Interp *iPtr = (Interp *)interp; Var *varPtr; Tcl_HashEntry *hPtr; - Tcl_Obj *varNameObj; int isNew; ArraySearch *searchPtr; const char *varName; @@ -3151,9 +3150,8 @@ ArrayStartSearchCmd( Tcl_WrongNumArgs(interp, 1, objv, "arrayName"); return TCL_ERROR; } - varNameObj = objv[1]; - if (TCL_ERROR == LocateArray(interp, varNameObj, &varPtr)) { + if (TCL_ERROR == LocateArray(interp, objv[1], &varPtr)) { return TCL_ERROR; } @@ -3163,7 +3161,7 @@ ArrayStartSearchCmd( * traces. */ - varName = TclGetString(varNameObj); + varName = TclGetString(objv[1]); if ((varPtr == NULL) || !TclIsVarArray(varPtr) || TclIsVarUndefined(varPtr)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( @@ -3494,16 +3492,14 @@ ArrayExistsCmd( { Interp *iPtr = (Interp *)interp; Var *varPtr; - Tcl_Obj *arrayNameObj; int notArray; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "arrayName"); return TCL_ERROR; } - arrayNameObj = objv[1]; - if (TCL_ERROR == LocateArray(interp, arrayNameObj, &varPtr)) { + if (TCL_ERROR == LocateArray(interp, objv[1], &varPtr)) { return TCL_ERROR; } @@ -3713,7 +3709,7 @@ ArrayNamesCmd( }; enum options { OPT_EXACT, OPT_GLOB, OPT_REGEXP }; Var *varPtr, *varPtr2; - Tcl_Obj *varNameObj, *nameObj, *resultObj, *patternObj; + Tcl_Obj *nameObj, *resultObj, *patternObj; Tcl_HashSearch search; const char *pattern = NULL; int mode = OPT_GLOB; @@ -3722,10 +3718,9 @@ ArrayNamesCmd( Tcl_WrongNumArgs(interp, 1, objv, "arrayName ?mode? ?pattern?"); return TCL_ERROR; } - varNameObj = objv[1]; patternObj = (objc > 2 ? objv[objc-1] : NULL); - if (TCL_ERROR == LocateArray(interp, varNameObj, &varPtr)) { + if (TCL_ERROR == LocateArray(interp, objv[1], &varPtr)) { return TCL_ERROR; } @@ -3922,7 +3917,6 @@ ArraySizeCmd( Tcl_Obj *const objv[]) { Var *varPtr; - Tcl_Obj *varNameObj; Tcl_HashSearch search; Var *varPtr2; int size = 0; @@ -3931,9 +3925,8 @@ ArraySizeCmd( Tcl_WrongNumArgs(interp, 1, objv, "arrayName"); return TCL_ERROR; } - varNameObj = objv[1]; - if (TCL_ERROR == LocateArray(interp, varNameObj, &varPtr)) { + if (TCL_ERROR == LocateArray(interp, objv[1], &varPtr)) { return TCL_ERROR; } |