diff options
author | 2021-02-21 17:16:04 +0200 | |
---|---|---|
committer | 2021-02-21 17:16:04 +0200 | |
commit | f110dbc40259c9367469eca6d1ae31842c72f02a (patch) | |
tree | e055b98b3785c53908847b27227ce69755971d3f /src/defs.h | |
parent | 29712a5098842ea3930ec00ddd1c0b9d264ba9b5 (diff) | |
download | algos-ld1-f110dbc40259c9367469eca6d1ae31842c72f02a.tar.gz algos-ld1-f110dbc40259c9367469eca6d1ae31842c72f02a.tar.bz2 algos-ld1-f110dbc40259c9367469eca6d1ae31842c72f02a.zip |
employ the unlikely macro on diagnostics.
This improves performance by about ~2%, testing shows.
Signed-off-by: Gediminas Jakutis <gediminas@varciai.lt>
Diffstat (limited to 'src/defs.h')
-rw-r--r-- | src/defs.h | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -9,14 +9,15 @@ #include <stdint.h> #include <sys/types.h> #include <rin/diagnostic.h> +#include <rin/definitions.h> #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;\ |