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-Tag: 1.0.1~20 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/catacomb-python/commitdiff_plain/2308db6f3426903c7af459627c7195912c1bce6a?ds=sidebyside 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));