summaryrefslogtreecommitdiffstats
path: root/Objects/listobject.c
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-03-10 11:44:04 (GMT)
committerRaymond Hettinger <python@rcn.com>2004-03-10 11:44:04 (GMT)
commit66d31f8f3812f91d8d9bf7878f93fabe6f005082 (patch)
tree27113c349cfb54b3eb98dd96556fb5b1088685e5 /Objects/listobject.c
parentef9bf4031a2f9ec674817274c93a90e0f21db114 (diff)
downloadcpython-66d31f8f3812f91d8d9bf7878f93fabe6f005082.zip
cpython-66d31f8f3812f91d8d9bf7878f93fabe6f005082.tar.gz
cpython-66d31f8f3812f91d8d9bf7878f93fabe6f005082.tar.bz2
Use memcpy() instead of memmove() when the buffers are known to be distinct.
Diffstat (limited to 'Objects/listobject.c')
-rw-r--r--Objects/listobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c
index 500f823..b61d7da 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -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++) {