From 682479592b33b13a22143f4fe67678c066bf223a Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Sat, 15 May 2021 16:20:59 -0500 Subject: [PATCH] ruby: add unlikely hint The error path is very unlikely. Signed-off-by: Felipe Contreras --- bindings/ruby/defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/ruby/defs.h b/bindings/ruby/defs.h index ae3ea101..12538a3a 100644 --- a/bindings/ruby/defs.h +++ b/bindings/ruby/defs.h @@ -58,7 +58,7 @@ extern ID ID_db_mode; #define Data_Get_Notmuch_Object(obj, ptr) \ do { \ (ptr) = rb_data_object_get ((obj)); \ - if (!(ptr)) { \ + if (RB_UNLIKELY (!(ptr))) { \ VALUE cname = rb_class_name (CLASS_OF ((obj))); \ rb_raise (rb_eRuntimeError, "%"PRIsVALUE" object destroyed", cname); \ } \