mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-14 17:13:40 +00:00
Simplify likely/unlikely
This surprisingly saves bytes and speeds up.
This commit is contained in:
parent
2f9945ca01
commit
db730f46d0
1 changed files with 2 additions and 2 deletions
|
@ -255,8 +255,8 @@ extern "C" void hb_free_impl(void *ptr);
|
|||
#endif
|
||||
|
||||
#if defined(__OPTIMIZE__) && hb_has_builtin(__builtin_expect)
|
||||
#define likely(expr) (__builtin_expect (!!(expr), 1))
|
||||
#define unlikely(expr) (__builtin_expect (!!(expr), 0))
|
||||
#define likely(expr) (__builtin_expect (bool(expr), 1))
|
||||
#define unlikely(expr) (__builtin_expect (bool(expr), 0))
|
||||
#else
|
||||
#define likely(expr) (expr)
|
||||
#define unlikely(expr) (expr)
|
||||
|
|
Loading…
Add table
Reference in a new issue