diff --git a/include/types.h b/include/types.h index 2a2780f75..da3e6c5b0 100644 --- a/include/types.h +++ b/include/types.h @@ -60,6 +60,10 @@ typedef Sint8 fx_ch_t; // FX-channel (0 to MAX_EFFECT_CHANNEL) typedef Uint32 jo_id_t; // (unique) ID of a journalling object +// use for improved branch prediction +#define likely(x) __builtin_expect((x),1) +#define unlikely(x) __builtin_expect((x),0) + template struct typeInfo @@ -100,6 +104,10 @@ inline float typeInfo::minEps( void ) template<> inline bool typeInfo::isEqual( float _x, float _y ) { + if( likely( _x == _y ) ) + { + return true; + } return absVal( _x - _y ) < minEps(); } @@ -121,8 +129,4 @@ typedef sample_t sampleFrame[DEFAULT_CHANNELS]; typedef sample_t surroundSampleFrame[SURROUND_CHANNELS]; -// use for improved branch prediction -#define likely(x) __builtin_expect((x),1) -#define unlikely(x) __builtin_expect((x),0) - #endif