summaryrefslogtreecommitdiffstats
path: root/generic/tclDictObj.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-09-29 22:17:28 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-09-29 22:17:28 (GMT)
commit1d5b0da0c8f65eeca48341adca32a96a8774f84a (patch)
tree9a574faca8ab395bddcb8ebbfcba24f070a7296a /generic/tclDictObj.c
parente63ee140f8bf8b9c127ad90c03a516be076d6ae1 (diff)
downloadtcl-1d5b0da0c8f65eeca48341adca32a96a8774f84a.zip
tcl-1d5b0da0c8f65eeca48341adca32a96a8774f84a.tar.gz
tcl-1d5b0da0c8f65eeca48341adca32a96a8774f84a.tar.bz2
Factorize out the code for freeing an object's internal rep.
Diffstat (limited to 'generic/tclDictObj.c')
-rw-r--r--generic/tclDictObj.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c
index 4b5f4d4..327fb92 100644
--- a/generic/tclDictObj.c
+++ b/generic/tclDictObj.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: tclDictObj.c,v 1.17 2004/07/11 23:01:28 dkf Exp $
+ * RCS: @(#) $Id: tclDictObj.c,v 1.18 2004/09/29 22:17:31 dkf Exp $
*/
#include "tclInt.h"
@@ -361,7 +361,6 @@ SetDictFromAny(interp, objPtr)
Tcl_Interp *interp;
Tcl_Obj *objPtr;
{
- Tcl_ObjType *oldTypePtr = objPtr->typePtr;
char *string, *s;
CONST char *elemStart, *nextElem;
int lenRemain, length, elemSize, hasBrace, result, isNew;
@@ -378,7 +377,7 @@ SetDictFromAny(interp, objPtr)
* special-case the conversion from lists to dictionaries.
*/
- if (oldTypePtr == &tclListType) {
+ if (objPtr->typePtr == &tclListType) {
int objc, i;
Tcl_Obj **objv;
@@ -523,10 +522,7 @@ SetDictFromAny(interp, objPtr)
* Tcl_GetStringFromObj, to use that old internalRep.
*/
- if ((oldTypePtr != NULL) && (oldTypePtr->freeIntRepProc != NULL)) {
- oldTypePtr->freeIntRepProc(objPtr);
- }
-
+ TclFreeIntRep(objPtr);
dict->epoch = 0;
dict->chain = NULL;
dict->refcount = 1;