move from std::numeric_limits::min() to boost::integer_traits::const_min - avoids runtime overhead of the function call.
This commit is contained in:
parent
e5a29ede5f
commit
2805af1ed2
@ -17,7 +17,7 @@
|
|||||||
#include <boost/bind.hpp>
|
#include <boost/bind.hpp>
|
||||||
#include <boost/cstdint.hpp>
|
#include <boost/cstdint.hpp>
|
||||||
#include <boost/type_traits/add_const.hpp>
|
#include <boost/type_traits/add_const.hpp>
|
||||||
#include <limits>
|
#include <boost/integer_traits.hpp>
|
||||||
|
|
||||||
namespace chaiscript
|
namespace chaiscript
|
||||||
{
|
{
|
||||||
@ -818,8 +818,8 @@ namespace chaiscript
|
|||||||
|
|
||||||
Boxed_Value smart_size(boost::int64_t i) const
|
Boxed_Value smart_size(boost::int64_t i) const
|
||||||
{
|
{
|
||||||
if (i < std::numeric_limits<int>::min()
|
if (i < boost::integer_traits<int>::const_min
|
||||||
|| i > std::numeric_limits<int>::max())
|
|| i > boost::integer_traits<int>::const_max)
|
||||||
{
|
{
|
||||||
return Boxed_Value(i);
|
return Boxed_Value(i);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user