Fix EmptyQuery to properly return an empty iterator

This commit is contained in:
EncodedVenom 2024-07-08 08:30:30 -04:00
parent 97d6955da0
commit a2f5c4e87d
No known key found for this signature in database
GPG key ID: 55A4643DA68078EF

View file

@ -662,7 +662,7 @@ local function noop(_self: Query, ...): () -> ()
end end
local EmptyQuery = { local EmptyQuery = {
__iter = iterNoop, __iter = noop,
next = noop, next = noop,
replace = noop, replace = noop,
without = function(self) without = function(self)
@ -670,6 +670,8 @@ local EmptyQuery = {
end end
} }
setmetatable(EmptyQuery, EmptyQuery)
export type Query = typeof(EmptyQuery) export type Query = typeof(EmptyQuery)
type CompatibleArchetype = { archetype: Archetype, indices: { number } } type CompatibleArchetype = { archetype: Archetype, indices: { number } }