Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3287c83 commit 0377547Copy full SHA for 0377547
1 file changed
Objects/longobject.c
@@ -4828,21 +4828,12 @@ long_divmod(PyObject *a, PyObject *b)
4828
static PyLongObject *
4829
long_invmod(PyLongObject *a, PyLongObject *n)
4830
{
4831
- PyLongObject *b, *c;
4832
-
4833
/* Should only ever be called for positive n */
4834
assert(_PyLong_IsPositive(n));
4835
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
4844
4845
Py_INCREF(a);
+ PyLongObject *b = (PyLongObject *)Py_NewRef(_PyLong_GetOne());
+ PyLongObject *c = (PyLongObject *)Py_NewRef(_PyLong_GetZero());
4846
Py_INCREF(n);
4847
4848
/* references now owned: a, b, c, n */
0 commit comments