Message75540
| Author |
vstinner |
| Recipients |
christian.heimes, gregory.p.smith, mark.dickinson, vstinner |
| Date |
2008年11月06日.02:32:18 |
| SpamBayes Score |
0.07905292 |
| Marked as misclassified |
No |
| Message-id |
<1225938740.06.0.158546795037.issue4258@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
PyLong_FromLong() doesn't go into the 1 digit special case for
negative number. You should use:
/* Fast path for single-digits ints */
if (!(abs_ival>>PyLong_SHIFT)) {
v = _PyLong_New(1);
if (v) {
Py_SIZE(v) = sign;
v->ob_digit[0] = abs_ival;
}
return (PyObject*)v;
} |
|