mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-12-01 10:34:23 +01:00
Simplify likely/unlikely
This surprisingly saves bytes and speeds up.
This commit is contained in:
1 parent
2f9945ca01
commit
db730f46d0
1 file changed
+2
-2
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user