diff options
Diffstat (limited to 'generic/tclListObj.c')
-rw-r--r-- | generic/tclListObj.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/generic/tclListObj.c b/generic/tclListObj.c index cdd8cb9..446a67e 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclListObj.c,v 1.13 2002/01/07 23:09:13 dgp Exp $ + * RCS: @(#) $Id: tclListObj.c,v 1.13.4.1 2004/11/11 01:18:07 das Exp $ */ #include "tclInt.h" @@ -680,17 +680,9 @@ Tcl_ListObjReplace(interp, listPtr, first, count, objc, objv) if ((numAfterLast > 0) && (shift != 0)) { Tcl_Obj **src, **dst; - if (shift < 0) { - for (src = elemPtrs + start, dst = src + shift; - numAfterLast > 0; numAfterLast--, src++, dst++) { - *dst = *src; - } - } else { - for (src = elemPtrs + numElems - 1, dst = src + shift; - numAfterLast > 0; numAfterLast--, src--, dst--) { - *dst = *src; - } - } + src = elemPtrs + start; dst = src + shift; + memmove((VOID*) dst, (VOID*) src, + (size_t) (numAfterLast * sizeof(Tcl_Obj*))); } /* |