[font/draw] Remove unneeded branch
The preamble sets user_data/destroy to nullptr if func is nullptr.
This commit is contained in:
parent
976bb26cc1
commit
56d6b6992b
|
@ -147,20 +147,15 @@ hb_draw_funcs_set_##name##_func (hb_draw_funcs_t *dfuncs, \
|
|||
if (!_hb_draw_funcs_set_middle (dfuncs, user_data, destroy)) \
|
||||
return; \
|
||||
\
|
||||
if (func) { \
|
||||
if (func) \
|
||||
dfuncs->func.name = func; \
|
||||
else \
|
||||
dfuncs->func.name = hb_draw_##name##_nil; \
|
||||
\
|
||||
if (dfuncs->user_data) \
|
||||
dfuncs->user_data->name = user_data; \
|
||||
if (dfuncs->destroy) \
|
||||
dfuncs->destroy->name = destroy; \
|
||||
} else { \
|
||||
dfuncs->func.name = hb_draw_##name##_nil; \
|
||||
if (dfuncs->user_data) \
|
||||
dfuncs->user_data->name = nullptr; \
|
||||
if (dfuncs->destroy) \
|
||||
dfuncs->destroy->name = nullptr; \
|
||||
} \
|
||||
return; \
|
||||
}
|
||||
|
||||
HB_DRAW_FUNCS_IMPLEMENT_CALLBACKS
|
||||
|
|
|
@ -889,19 +889,15 @@ hb_font_funcs_set_##name##_func (hb_font_funcs_t *ffuncs, \
|
|||
if (!_hb_font_funcs_set_middle (ffuncs, user_data, destroy)) \
|
||||
return; \
|
||||
\
|
||||
if (func) { \
|
||||
if (func) \
|
||||
ffuncs->get.f.name = func; \
|
||||
else \
|
||||
ffuncs->get.f.name = hb_font_get_##name##_default; \
|
||||
\
|
||||
if (ffuncs->user_data) \
|
||||
ffuncs->user_data->name = user_data; \
|
||||
if (ffuncs->destroy) \
|
||||
ffuncs->destroy->name = destroy; \
|
||||
} else { \
|
||||
ffuncs->get.f.name = hb_font_get_##name##_default; \
|
||||
if (ffuncs->user_data) \
|
||||
ffuncs->user_data->name = nullptr; \
|
||||
if (ffuncs->destroy) \
|
||||
ffuncs->destroy->name = nullptr; \
|
||||
} \
|
||||
}
|
||||
|
||||
HB_FONT_FUNCS_IMPLEMENT_CALLBACKS
|
||||
|
|
Loading…
Reference in New Issue