mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-21 18:38:08 +01:00
ruby: improve general data get helper
There's no need to do Check_Type, Data_Get_Struct calls rb_data_object_get(), which already does that. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
This commit is contained in:
parent
2e57ffb860
commit
a34d7b4144
1 changed files with 2 additions and 3 deletions
|
@ -57,10 +57,9 @@ extern ID ID_db_mode;
|
|||
|
||||
#define Data_Get_Notmuch_Object(obj, type, message, ptr) \
|
||||
do { \
|
||||
Check_Type ((obj), T_DATA); \
|
||||
if (DATA_PTR ((obj)) == NULL) \
|
||||
rb_raise (rb_eRuntimeError, (message)); \
|
||||
Data_Get_Struct ((obj), type, (ptr)); \
|
||||
if (!(ptr)) \
|
||||
rb_raise (rb_eRuntimeError, (message)); \
|
||||
} while (0)
|
||||
|
||||
#define Data_Get_Notmuch_Database(obj, ptr) \
|
||||
|
|
Loading…
Reference in a new issue