memgraph/include/utils/likely.hpp
2016-08-10 09:39:02 +01:00

11 lines
250 B
C++

#pragma once
#if __GNUC__ >= 3
// make a hint for the branch predictor in a conditional or a loop
#define LIKELY(x) __builtin_expect(!!(x), 1)
#define UNLIKELY(x) __builtin_expect(!!(x), 0)
#else
#define LIKELY(x) (x)
#define UNLIKELY(x) (x)
#endif