mirror of
https://github.com/Ukendio/jecs.git
synced 2025-04-25 09:30:03 +00:00
Fix EmptyQuery to properly return an empty iterator
This commit is contained in:
parent
97d6955da0
commit
a2f5c4e87d
1 changed files with 3 additions and 1 deletions
|
@ -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 } }
|
||||||
|
|
Loading…
Reference in a new issue