remove redundant empty table notification
@@ -219,15 +219,8 @@ static
void table_activate(
ecs_world_t *world,
ecs_table_t *table,
- ecs_query_t *query,
bool activate)
{
- if (query) {
- flecs_query_notify(world, query, &(ecs_query_event_t) {
- .kind = activate ? EcsQueryTableNonEmpty : EcsQueryTableEmpty,
- .table = table
- });
- } else {
ecs_vector_t *queries = table->queries;
ecs_query_t **buffer = ecs_vector_first(queries, ecs_query_t*);
int32_t i, count = ecs_vector_count(queries);
@@ -239,7 +232,6 @@ void table_activate(
});
}
}
-}
/* This function is called when a query is matched with a table. A table keeps
* a list of tables that match so that they can be notified when the table
@@ -261,10 +253,6 @@ void register_query(
ecs_query_t **q = ecs_vector_add(&table->queries, ecs_query_t*);
if (q) *q = query;
-
- if (ecs_table_count(table)) {
- table_activate(world, table, query, true);
- }
}
/* This function is called when a query is unmatched with a table. This can
@@ -511,7 +499,7 @@ void fini_data(
data->record_ptrs = NULL;
if (deactivate && count) {
- table_activate(world, table, 0, false);
+ table_activate(world, table, false);
}
}
@@ -886,7 +874,7 @@ int32_t grow_data(
mark_table_dirty(table, 0);
if (!world->is_readonly && !cur_count) {
- table_activate(world, table, 0, true);
+ table_activate(world, table, true);
}
table->alloc_count ++;
@@ -951,7 +939,7 @@ int32_t flecs_table_append(
/* If this is the first entity in this table, signal queries so that the
* table moves from an inactive table to an active table. */
if (!world->is_readonly && !count) {
- table_activate(world, table, 0, true);
+ table_activate(world, table, true);
}
ecs_assert(count >= 0, ECS_INTERNAL_ERROR, NULL);
@@ -1100,7 +1088,7 @@ void flecs_table_delete(
/* If table is empty, deactivate it */
if (!count) {
- table_activate(world, table, NULL, false);
+ table_activate(world, table, false);
}
/* Destruct component data */
@@ -1802,7 +1790,7 @@ void flecs_table_merge(
new_table->alloc_count ++;
if (!new_count && old_count) {
- table_activate(world, new_table, NULL, true);
+ table_activate(world, new_table, true);
}
}
@@ -1829,9 +1817,9 @@ void flecs_table_replace_data(
int32_t count = ecs_table_count(table);
if (!prev_count && count) {
- table_activate(world, table, 0, true);
+ table_activate(world, table, true);
} else if (prev_count && !count) {
- table_activate(world, table, 0, false);
+ table_activate(world, table, false);
}
}
