From 494d28ad988e505c1c45cc35a7ec6b880cfec5fc Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 10 May 2010 23:50:07 -0400 Subject: [PATCH] Simplify likely() implementation Shrinks .text by 1%! --- src/hb-private.h | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/hb-private.h b/src/hb-private.h index 8a323decf..866ee59c0 100644 --- a/src/hb-private.h +++ b/src/hb-private.h @@ -85,15 +85,7 @@ #if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__) -#define _HB_BOOLEAN_EXPR(expr) \ - __extension__ ({ \ - int _hb_boolean_var_; \ - if (expr) \ - _hb_boolean_var_ = 1; \ - else \ - _hb_boolean_var_ = 0; \ - _hb_boolean_var_; \ - }) +#define _HB_BOOLEAN_EXPR(expr) ((expr) ? 1 : 0) #define likely(expr) (__builtin_expect (_HB_BOOLEAN_EXPR(expr), 1)) #define unlikely(expr) (__builtin_expect (_HB_BOOLEAN_EXPR(expr), 0)) #else