mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-24 06:05:01 +02:00
Merge pull request #7300 from Icinga/bugfix/gcc-likely
Quality: Prefer BOOST_{,UN}LIKELY gcc optimizer macros over our own
This commit is contained in:
commit
0712589bd1
@ -72,14 +72,6 @@
|
|||||||
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__)
|
|
||||||
# define likely(x) __builtin_expect(!!(x), 1)
|
|
||||||
# define unlikely(x) __builtin_expect(!!(x), 0)
|
|
||||||
#else
|
|
||||||
# define likely(x) (x)
|
|
||||||
# define unlikely(x) (x)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define BOOST_BIND_NO_PLACEHOLDERS
|
#define BOOST_BIND_NO_PLACEHOLDERS
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
@ -235,10 +235,10 @@ public:
|
|||||||
|
|
||||||
static inline Value GetField(const Value& context, const String& field, bool sandboxed = false, const DebugInfo& debugInfo = DebugInfo())
|
static inline Value GetField(const Value& context, const String& field, bool sandboxed = false, const DebugInfo& debugInfo = DebugInfo())
|
||||||
{
|
{
|
||||||
if (unlikely(context.IsEmpty() && !context.IsString()))
|
if (BOOST_UNLIKELY(context.IsEmpty() && !context.IsString()))
|
||||||
return Empty;
|
return Empty;
|
||||||
|
|
||||||
if (unlikely(!context.IsObject()))
|
if (BOOST_UNLIKELY(!context.IsObject()))
|
||||||
return GetPrototypeField(context, field, true, debugInfo);
|
return GetPrototypeField(context, field, true, debugInfo);
|
||||||
|
|
||||||
Object::Ptr object = context;
|
Object::Ptr object = context;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user