]> granicus.if.org Git - python/commitdiff
memset() hunt continuing. This is a net win.
authorArmin Rigo <arigo@tunes.org>
Sat, 20 Mar 2004 21:35:09 +0000 (21:35 +0000)
committerArmin Rigo <arigo@tunes.org>
Sat, 20 Mar 2004 21:35:09 +0000 (21:35 +0000)
Objects/tupleobject.c

index 60878a43145ae96d7aabc0501e08516f8b8bb337..159dc44fd07e7ee28622fb835f46a8eea5dd9912 100644 (file)
@@ -27,6 +27,7 @@ PyObject *
 PyTuple_New(register int size)
 {
        register PyTupleObject *op;
+       int i;
        if (size < 0) {
                PyErr_BadInternalCall();
                return NULL;
@@ -68,7 +69,8 @@ PyTuple_New(register int size)
                if (op == NULL)
                        return NULL;
        }
-       memset(op->ob_item, 0, sizeof(*op->ob_item) * size);
+       for (i=0; i < size; i++)
+               op->ob_item[i] = NULL;
 #if MAXSAVESIZE > 0
        if (size == 0) {
                free_tuples[0] = op;