Skip to content

Commit cc6aca0

Browse files
skirpichevpicnixz
andauthored
Apply suggestion from @picnixz
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
1 parent b3b5f47 commit cc6aca0

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

Modules/mathintegermodule.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -522,16 +522,14 @@ math_integer_isqrt_rem(PyObject *module, PyObject *n)
522522
{
523523
PyObject *rem = NULL;
524524
PyObject *root = _isqrt_rem(n, &rem);
525+
PyObject *res = NULL;
525526

526527
if (root && rem) {
527-
PyObject *tup = PyTuple_Pack(2, root, rem);
528-
529-
Py_DECREF(root);
530-
Py_DECREF(rem);
531-
return tup;
528+
res = PyTuple_Pack(2, root, rem);
532529
}
533530
Py_XDECREF(root);
534531
Py_XDECREF(rem);
532+
return res;
535533
return NULL;
536534
}
537535

0 commit comments

Comments
 (0)