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:
parent
776398cd1d
commit
32b10ee9b7
1 changed files with 6 additions and 1 deletions
|
|
@ -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; \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue