Commit 7cdf3e8a authored by Armin Rigo's avatar Armin Rigo

memset() hunt continuing. This is a net win.

parent cc45466b
...@@ -27,6 +27,7 @@ PyObject * ...@@ -27,6 +27,7 @@ PyObject *
PyTuple_New(register int size) PyTuple_New(register int size)
{ {
register PyTupleObject *op; register PyTupleObject *op;
int i;
if (size < 0) { if (size < 0) {
PyErr_BadInternalCall(); PyErr_BadInternalCall();
return NULL; return NULL;
...@@ -68,7 +69,8 @@ PyTuple_New(register int size) ...@@ -68,7 +69,8 @@ PyTuple_New(register int size)
if (op == NULL) if (op == NULL)
return 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 MAXSAVESIZE > 0
if (size == 0) { if (size == 0) {
free_tuples[0] = op; free_tuples[0] = op;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment