From 7f2d6a9e79a9bdc07226492422a3cfe9a1eae498 Mon Sep 17 00:00:00 2001 From: Ukendio Date: Sun, 28 Jul 2024 14:36:53 +0200 Subject: [PATCH] Add comment to world_query_archetypes --- src/init.luau | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/init.luau b/src/init.luau index c7b9661..40069be 100644 --- a/src/init.luau +++ b/src/init.luau @@ -926,15 +926,20 @@ do return query end + -- Meant for directly iterating over archetypes to minimize + -- function call overhead. Should not be used unless iterating over + -- hundreds of thousands of entities in bulk. + local function world_query_archetypes() + return compatible_archetypes + end + local it = { __iter = world_query_iter, next = world_query_next, with = world_query_with, without = world_query_without, replace = world_query_replace, - archetypes = function() - return compatible_archetypes - end + archetypes = world_query_archetypes } :: any setmetatable(it, it)