File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -4828,21 +4828,12 @@ long_divmod(PyObject *a, PyObject *b)
4828
4828
static PyLongObject *
4829
4829
long_invmod (PyLongObject * a , PyLongObject * n )
4830
4830
{
4831
- PyLongObject * b , * c ;
4832
-
4833
4831
/* Should only ever be called for positive n */
4834
4832
assert (_PyLong_IsPositive (n ));
4835
4833
4836
- b = (PyLongObject * )PyLong_FromLong (1L );
4837
- if (b == NULL ) {
4838
- return NULL ;
4839
- }
4840
- c = (PyLongObject * )PyLong_FromLong (0L );
4841
- if (c == NULL ) {
4842
- Py_DECREF (b );
4843
- return NULL ;
4844
- }
4845
4834
Py_INCREF (a );
4835
+ PyLongObject * b = (PyLongObject * )Py_NewRef (_PyLong_GetOne ());
4836
+ PyLongObject * c = (PyLongObject * )Py_NewRef (_PyLong_GetZero ());
4846
4837
Py_INCREF (n );
4847
4838
4848
4839
/* references now owned: a, b, c, n */
You can’t perform that action at this time.
0 commit comments