From: Mark Wooding Date: Wed, 23 Oct 2019 22:18:00 +0000 (+0100) Subject: field.c: Convert external-format field element to hex/octal. X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb-python/commitdiff_plain/d9782ff0f48dc1da24eb4c58450affc3cacc06df?hp=56e8606ccec4aaa4958ec7027d133bbe7b80fb2d field.c: Convert external-format field element to hex/octal. Rather than going through the effort of calculating the external representation of the field element and then returning the internal version. --- diff --git a/field.c b/field.c index 024c578..fae0365 100644 --- a/field.c +++ b/field.c @@ -274,7 +274,7 @@ static PyObject *fe_pylong(PyObject *x) #define BASEOP(name, radix, pre) \ static PyObject *fe_py##name(PyObject *x) { \ mp *xx = F_OUT(FE_F(x), MP_NEW, FE_X(x)); \ - PyObject *rc = mp_topystring(FE_X(x), radix, 0, pre, 0); \ + PyObject *rc = mp_topystring(xx, radix, 0, pre, 0); \ MP_DROP(xx); \ return (rc); \ }