Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | revise [dict append] to make use of common [string cat] engine. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | dgp-string-cat |
Files: | files | file ages | folders |
SHA1: |
673871f49c8ef2a192e89033ba1bb82b |
User & Date: | dgp 2016-10-28 16:55:44.803 |
Context
2016-10-28
| ||
20:33 | WIP check-in: 8f63620a09 user: dgp tags: dgp-string-cat | |
16:55 | revise [dict append] to make use of common [string cat] engine. check-in: 673871f49c user: dgp tags: dgp-string-cat | |
15:47 | merge trunk check-in: 65b0c59fbd user: dgp tags: dgp-string-cat | |
Changes
Changes to generic/tclDictObj.c.
︙ | ︙ | |||
2278 2279 2280 2281 2282 2283 2284 | DictAppendCmd( ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Tcl_Obj *dictPtr, *valuePtr, *resultPtr; | | | 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 | DictAppendCmd( ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Tcl_Obj *dictPtr, *valuePtr, *resultPtr; int allocatedDict = 0; if (objc < 3) { Tcl_WrongNumArgs(interp, 1, objv, "dictVarName key ?value ...?"); return TCL_ERROR; } dictPtr = Tcl_ObjGetVar2(interp, objv[1], NULL, 0); |
︙ | ︙ | |||
2303 2304 2305 2306 2307 2308 2309 2310 | TclDecrRefCount(dictPtr); } return TCL_ERROR; } if ((objc > 3) || (valuePtr == NULL)) { /* Only go through append activites when something will change. */ | > > > > > > > > > > > > | > > > > > > > | | | < | | 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 | TclDecrRefCount(dictPtr); } return TCL_ERROR; } if ((objc > 3) || (valuePtr == NULL)) { /* Only go through append activites when something will change. */ Tcl_Obj *appendObjPtr = NULL; if (objc > 3) { /* Something to append */ if (objc == 4) { appendObjPtr = objv[3]; } else if (TCL_OK != TclStringCatObjv(interp, objc-3, objv+3, &appendObjPtr)) { return TCL_ERROR; } } if (appendObjPtr == NULL) { /* => (objc == 3) => (valuePtr == NULL) */ TclNewObj(valuePtr); } else if (valuePtr == NULL) { valuePtr = appendObjPtr; appendObjPtr = NULL; } if (appendObjPtr) { if (Tcl_IsShared(valuePtr)) { valuePtr = Tcl_DuplicateObj(valuePtr); } Tcl_AppendObjToObj(valuePtr, appendObjPtr); } Tcl_DictObjPut(NULL, dictPtr, objv[2], valuePtr); } /* * Even if nothing changed, we still overwrite so that variable |
︙ | ︙ |