mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Use the new Py_ARRAY_LENGTH macro
This commit is contained in:
parent
b9dcffb51e
commit
639418812f
15 changed files with 26 additions and 28 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue