From acba47fee20e7791d19f858df94f8606f6e63ae1 Mon Sep 17 00:00:00 2001 From: Ukendio Date: Sun, 26 May 2024 05:01:52 +0200 Subject: [PATCH] Fix EmptyQuery --- lib/init.lua | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/lib/init.lua b/lib/init.lua index b2d56dc..27cb078 100644 --- a/lib/init.lua +++ b/lib/init.lua @@ -642,16 +642,21 @@ function World.get(world: World, entityId: i53, a: i53, b: i53?, c: i53?, d: i53 end end --- the less creation the better -local function actualNoOperation() end -local function noop(_self: Query, ...: i53): () -> (number, ...any) - return actualNoOperation :: any +local function noop() end +local function iterNoop(_self: Query, ...: i53): () -> (number, ...any) + return noop :: any end -local EmptyQuery = { - __iter = noop; - without = noop; +local EmptyQuery +EmptyQuery = { + __iter = iterNoop, + next = noop, + patch = noop, + without = function() + return EmptyQuery + end } + EmptyQuery.__index = EmptyQuery setmetatable(EmptyQuery, EmptyQuery)