Remove unused nesting in behavior struct.
This commit is contained in:
12
src/custom.c
12
src/custom.c
@@ -2,19 +2,19 @@
|
||||
|
||||
void libab_behavior_init_internal(libab_behavior* behavior,
|
||||
libab_function_ptr func) {
|
||||
behavior->impl.variant = BIMPL_INTERNAL;
|
||||
behavior->impl.data_u.internal = func;
|
||||
behavior->variant = BIMPL_INTERNAL;
|
||||
behavior->data_u.internal = func;
|
||||
}
|
||||
|
||||
void libab_behavior_init_tree(libab_behavior* behavior,
|
||||
libab_tree* tree) {
|
||||
behavior->impl.variant = BIMPL_TREE;
|
||||
behavior->impl.data_u.tree = tree;
|
||||
behavior->variant = BIMPL_TREE;
|
||||
behavior->data_u.tree = tree;
|
||||
}
|
||||
|
||||
void libab_behavior_free(libab_behavior* behavior) {
|
||||
if (behavior->impl.variant == BIMPL_TREE) {
|
||||
libab_tree_free_recursive(behavior->impl.data_u.tree);
|
||||
if (behavior->variant == BIMPL_TREE) {
|
||||
libab_tree_free_recursive(behavior->data_u.tree);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -93,8 +93,8 @@ void _sanitize(char* to, const char* from, size_t buffer_size) {
|
||||
|
||||
void _initialize_behavior(libab_behavior* behavior, libab_ref* type,
|
||||
libab_function_ptr func) {
|
||||
behavior->impl.variant = BIMPL_INTERNAL;
|
||||
behavior->impl.data_u.internal = func;
|
||||
behavior->variant = BIMPL_INTERNAL;
|
||||
behavior->data_u.internal = func;
|
||||
}
|
||||
|
||||
libab_result _register_operator(libab* ab, const char* op,
|
||||
|
||||
Reference in New Issue
Block a user