From f110dbc40259c9367469eca6d1ae31842c72f02a Mon Sep 17 00:00:00 2001 From: Gediminas Jakutis Date: Sun, 21 Feb 2021 17:16:04 +0200 Subject: employ the unlikely macro on diagnostics. This improves performance by about ~2%, testing shows. Signed-off-by: Gediminas Jakutis --- src/defs.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/defs.h') diff --git a/src/defs.h b/src/defs.h index 425e97c..e90f0e5 100644 --- a/src/defs.h +++ b/src/defs.h @@ -9,14 +9,15 @@ #include #include #include +#include #define try_s(a,l) do {\ - if(a) {\ + if(unlikely(a)) {\ goto l;\ }} while (0); #define try(a,l,e,m,...) do {\ - if(a) {\ + if(unlikely(a)) {\ ret = e;\ rin_err(m __VA_OPT__(,) __VA_ARGS__);\ goto l;\ -- cgit v1.2.3