diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-02-02 14:06:15 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-02-02 14:06:15 (GMT) |
commit | c9abd08463391eea2c29d413449d8ba0c4704363 (patch) | |
tree | 52707ce32e88437a67738d06b1a45bdf6e79c83d /generic/tclListObj.c | |
parent | 680d27740a871cd27464c07ed2afee0f4104dbd4 (diff) | |
download | tcl-c9abd08463391eea2c29d413449d8ba0c4704363.zip tcl-c9abd08463391eea2c29d413449d8ba0c4704363.tar.gz tcl-c9abd08463391eea2c29d413449d8ba0c4704363.tar.bz2 |
Inpired by [pyk-emptystring] branch: Shortcuts/speedsup in number handling when dicts or lists are involved. Suppress generation of string rep in more situations.
Diffstat (limited to 'generic/tclListObj.c')
-rw-r--r-- | generic/tclListObj.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/generic/tclListObj.c b/generic/tclListObj.c index c9fd333..749f5f2 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -415,7 +415,9 @@ TclListObjCopy( } TclNewObj(copyPtr); - TclInvalidateStringRep(copyPtr); + if (ListRepPtr(listPtr)->elemCount > 0) { + TclInvalidateStringRep(copyPtr); + } DupListInternalRep(listPtr, copyPtr); return copyPtr; } |