Dramatically sped up comparison functions for

integers.  This speeds up most std::set<int>, etc.
insertion operations.



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9830 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Gonzalo Garramuno 2007-05-23 12:46:57 +00:00
commit 32b10ee9b7

View file

@ -38,7 +38,8 @@ namespace swig {
%nodirector GC_VALUE;
// We ignore the constructor so that user can never create a GC_VALUE manually
// We ignore the constructor so that user can never create a GC_VALUE
// manually
%ignore GC_VALUE::GC_VALUE;
struct GC_VALUE {
@ -215,6 +216,10 @@ namespace swig {
#define GC_VALUE_CMP( op_id, op, cmp, cmpval ) \
bool op( const GC_VALUE& other ) const \
{ \
if ( FIXNUM_P(_obj) && FIXNUM_P(other._obj) ) \
{ \
return _obj cmp other._obj; \
} \
bool res = false; \
VALUE ret = Qnil; \
SWIG_RUBY_THREAD_BEGIN_BLOCK; \