]> granicus.if.org Git - python/commitdiff
Use memcpy() instead of memmove() when the buffers are known to be distinct.
authorRaymond Hettinger <python@rcn.com>
Wed, 10 Mar 2004 11:44:04 +0000 (11:44 +0000)
committerRaymond Hettinger <python@rcn.com>
Wed, 10 Mar 2004 11:44:04 +0000 (11:44 +0000)
Objects/listobject.c

index 500f823a9c56c7fc48f5b6a50dfb8b7973812e41..b61d7da0adff2cbb7681fb8e1b211a1cf394b9d6 100644 (file)
@@ -518,7 +518,7 @@ list_ass_slice(PyListObject *a, int ilow, int ihigh, PyObject *v)
        else
                p = recycle = NULL;
        if (d <= 0) { /* Delete -d items; recycle ihigh-ilow items */
-               memmove(p, &item[ilow], (ihigh - ilow)*sizeof(PyObject *));
+               memcpy(p, &item[ilow], (ihigh - ilow)*sizeof(PyObject *));
                p += ihigh - ilow;
                if (d < 0) {
                        memmove(&item[ihigh+d], &item[ihigh], 
@@ -537,7 +537,7 @@ list_ass_slice(PyListObject *a, int ilow, int ihigh, PyObject *v)
                item = a->ob_item;
                memmove(&item[ihigh+d], &item[ihigh],
                        (s - ihigh)*sizeof(PyObject *));
-               memmove(p, &item[ilow], (ihigh - ilow)*sizeof(PyObject *));
+               memcpy(p, &item[ilow], (ihigh - ilow)*sizeof(PyObject *));
                p += ihigh - ilow;
        }
        for (k = 0; k < n; k++, ilow++) {