On 30/04/2006 11:57 AM, kyo guan wrote:
> Hi :
>
> python list object like a stl vector, if insert a object in the front
> or the middle of it,
> all the object after the insert point need to move backward.
>
> look at this code ( in python 2.4.3)
>
> for (i = n; --i >= where; )
"kyo guan" wrote:
> for (i = n; --i >= where; ) /// here, why not use memmove? it would be more
> speed then this loop.
>items[i+1] = items[i];
have you benchmarked this on a wide variety of platforms, or are
you just guessing?
--
http://mail.python.org/mailman/listinfo/python-list
Hi :
python list object like a stl vector, if insert a object in the front
or the middle of it,
all the object after the insert point need to move backward.
look at this code ( in python 2.4.3)
static int
ins1(PyListObject *self, int where, PyObject *v)
{
int i, n = self->ob_siz