From: Mark Wooding Date: Wed, 22 Mar 2006 12:58:45 +0000 (+0000) Subject: getulong: Compare with LONG_MAX to decide what Python type to use. X-Git-Url: https://git.distorted.org.uk/~mdw/pyke/commitdiff_plain/4f3d0934b91624b7c3634a5e4d4ab4ddd2a175d3 getulong: Compare with LONG_MAX to decide what Python type to use. This may reduce the number of bignums created on 64-bit machines. --- diff --git a/util.c b/util.c index 166cdbb..1739ebe 100644 --- a/util.c +++ b/util.c @@ -34,7 +34,7 @@ PyObject *getulong(unsigned long w) { - if (w <= MASK32) + if (w <= LONG_MAX) return (PyInt_FromLong(w)); else return (PyLong_FromUnsignedLong(w));