2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-23 05:42:30 +00:00

Smarter range checking

[SVN r14380]
This commit is contained in:
Dave Abrahams
2002-07-09 18:57:53 +00:00
parent 222396759b
commit 5a0d84f185

View File

@@ -91,11 +91,10 @@ namespace
{
static T extract(PyObject* intermediate)
{
return numeric_cast<T>(
PyFloat_Check(intermediate)
? PyFloat_AS_DOUBLE(intermediate)
: PyInt_AS_LONG(intermediate)
);
return PyFloat_Check(intermediate)
? numeric_cast<T>(PyFloat_AS_DOUBLE(intermediate))
: numeric_cast<T>(PyInt_AS_LONG(intermediate))
;
}
};