diff options
author | dgp <dgp@users.sourceforge.net> | 2011-04-27 18:32:14 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2011-04-27 18:32:14 (GMT) |
commit | 0d12754dbe6102188981d9d78ca772201250947b (patch) | |
tree | d9ac97eac3ae2c7f2ffe55c456dff83270d6e1e1 /generic | |
parent | 3b9139924b1097de66255cd243de80d6eccb46ba (diff) | |
download | tcl-0d12754dbe6102188981d9d78ca772201250947b.zip tcl-0d12754dbe6102188981d9d78ca772201250947b.tar.gz tcl-0d12754dbe6102188981d9d78ca772201250947b.tar.bz2 |
FreeListInternalRep() cleanup.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclListObj.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/generic/tclListObj.c b/generic/tclListObj.c index 036d624..3b9dce6 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -1623,16 +1623,14 @@ static void FreeListInternalRep( Tcl_Obj *listPtr) /* List object with internal rep to free. */ { - register List *listRepPtr = ListRepPtr(listPtr); - register Tcl_Obj **elemPtrs = &listRepPtr->elements; - register Tcl_Obj *objPtr; - int numElems = listRepPtr->elemCount; - int i; + List *listRepPtr = ListRepPtr(listPtr); if (--listRepPtr->refCount <= 0) { + Tcl_Obj **elemPtrs = &listRepPtr->elements; + int i, numElems = listRepPtr->elemCount; + for (i = 0; i < numElems; i++) { - objPtr = elemPtrs[i]; - Tcl_DecrRefCount(objPtr); + Tcl_DecrRefCount(elemPtrs[i]); } ckfree((char *) listRepPtr); } |