@@ -3819,9 +3819,7 @@ int32_t flecs_table_grow_data(
38193819 /* Initialize entity ids and record ptrs */
38203820 int32_t i;
38213821 if (ids) {
3822- for (i = 0; i < to_add; i ++) {
3823- e[i] = ids[i];
3824- }
3822+ ecs_os_memcpy_n(e, ids, ecs_entity_t, to_add);
38253823 } else {
38263824 ecs_os_memset(e, 0, ECS_SIZEOF(ecs_entity_t) * to_add);
38273825 }
@@ -3834,6 +3832,8 @@ int32_t flecs_table_grow_data(
38343832 ecs_type_info_t *ti = type_info[i];
38353833 flecs_table_grow_column(world, column, ti, to_add, size, true);
38363834 ecs_assert(columns[i].size == size, ECS_INTERNAL_ERROR, NULL);
3835+ flecs_run_add_hooks(world, table, ti, column, e, table->type.array[i],
3836+ cur_count, to_add, false);
38373837 }
38383838
38393839 /* Add elements to each switch column */
@@ -4303,11 +4303,11 @@ int32_t flecs_table_appendn(
43034303 ecs_assert(!table->lock, ECS_LOCKED_STORAGE, NULL);
43044304
43054305 flecs_table_check_sanity(table);
4306-
43074306 int32_t cur_count = flecs_table_data_count(data);
43084307 int32_t result = flecs_table_grow_data(
43094308 world, table, data, to_add, cur_count + to_add, ids);
43104309 flecs_table_check_sanity(table);
4310+
43114311 return result;
43124312}
43134313
0 commit comments