Use the new Py_ARRAY_LENGTH macro

This commit is contained in:
Victor Stinner 2011-09-29 00:42:28 +02:00
parent b9dcffb51e
commit 639418812f
15 changed files with 26 additions and 28 deletions

View file

@ -1435,7 +1435,7 @@ math_factorial(PyObject *self, PyObject *arg)
}
/* use lookup table if x is small */
if (x < (long)(sizeof(SmallFactorials)/sizeof(SmallFactorials[0])))
if (x < (long)Py_ARRAY_LENGTH(SmallFactorials))
return PyLong_FromUnsignedLong(SmallFactorials[x]);
/* else express in the form odd_part * 2**two_valuation, and compute as