Skip to content

Commit

Permalink
Remove redundant group_by callback from group_iter example
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderMertens committed Sep 3, 2023
1 parent bed712c commit 4673dc2
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions examples/cpp/queries/group_iter/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,6 @@ struct Soldier {};
struct Beggar {};
struct Mage {};

uint64_t group_by_relation(flecs::world_t *ecs, flecs::table_t *table,
flecs::entity_t id, void *)
{
// Use ecs_search to find the target for the relationship in the table
flecs::id_t match;
if (ecs_search(ecs, table, flecs::id(id, flecs::Wildcard), &match) != -1) {
return flecs::id(ecs, match).second(); // World cell is 2nd element of pair
}
return 0;
}

int main() {
flecs::world ecs;

Expand Down Expand Up @@ -73,7 +62,7 @@ int main() {
.add<Npc>();

flecs::query<Npc> q = ecs.query_builder<Npc>()
.group_by<WorldCell>(group_by_relation)
.group_by<WorldCell>()
.build();

// Iterate all tables
Expand Down

0 comments on commit 4673dc2

Please sign in to comment.