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:
@@ -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))
|
||||
;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user