~mdw
/
catacomb-python
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
0efbd2f
)
mp.c: Simplify final cleanup in `MPCRT' operations.
author
Mark Wooding
<mdw@distorted.org.uk>
Mon, 25 Nov 2019 13:25:34 +0000
(13:25 +0000)
committer
Mark Wooding
<mdw@distorted.org.uk>
Sat, 11 Apr 2020 11:49:31 +0000
(12:49 +0100)
mp.c
patch
|
blob
|
blame
|
history
diff --git
a/mp.c
b/mp.c
index
6ce2792
..
456c905
100644
(file)
--- a/
mp.c
+++ b/
mp.c
@@
-1805,9
+1805,7
@@
static PyObject *mcmeth_solve(PyObject *me, PyObject *arg)
z = mp_pywrap(mpcrt_solve(c, MP_NEW, v));
end:
if (v) {
- n = i;
- for (i = 0; i < n; i++)
- MP_DROP(v[i]);
+ while (i--) MP_DROP(v[i]);
xfree(v);
}
return (z);
@@
-1860,9
+1858,7
@@
static PyObject *mpcrt_pynew(PyTypeObject *ty, PyObject *arg, PyObject *kw)
end:
if (v) {
- n = i;
- for (i = 0; i < n; i++)
- MP_DROP(v[i].m);
+ while (i--) MP_DROP(v[i].m);
xfree(v);
}
mp_drop(xx); mp_drop(y); mp_drop(g);