[unicode] Simplify set_funcs a bit more

This commit is contained in:
Behdad Esfahbod 2022-11-19 15:22:39 -07:00
parent 2d8ff3bcbe
commit dd88dae8a9
1 changed files with 5 additions and 8 deletions

View File

@ -384,21 +384,18 @@ hb_unicode_funcs_set_##name##_func (hb_unicode_funcs_t *ufuncs, \
if (destroy) \
destroy (user_data); \
destroy = nullptr; \
user_data = nullptr; \
user_data = ufuncs->parent->user_data.name; \
} \
\
if (ufuncs->destroy.name) \
ufuncs->destroy.name (ufuncs->user_data.name); \
\
if (func) { \
if (func) \
ufuncs->func.name = func; \
else \
ufuncs->func.name = ufuncs->parent->func.name; \
ufuncs->user_data.name = user_data; \
ufuncs->destroy.name = destroy; \
} else { \
ufuncs->func.name = ufuncs->parent->func.name; \
ufuncs->user_data.name = ufuncs->parent->user_data.name; \
ufuncs->destroy.name = nullptr; \
} \
return; \
\
fail: \