Skip to content

Commit

Permalink
Fixed incorrect usage of ipairs
Browse files Browse the repository at this point in the history
CHANGED:
- Was using ipairs instead of pairs to iterate over table storing keys
and values.  This led to keys not being propagated.
  • Loading branch information
Nathan Lam committed Feb 15, 2017
1 parent 3474e55 commit c68b6ac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scene.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function node:attach(child)
end

if child._ids then
for id, anode in ipairs(child._ids) do
for id, anode in pairs(child._ids) do
self:add_id(id, anode)
end
end
Expand All @@ -88,12 +88,12 @@ function node:detach()

-- Remove id from id tables of all ancestors
if self._id then
self:remove_id(self._id)
self.parent:remove_id(self._id)
end

if self._ids then
for id, _ in ipairs(self._ids) do
self:remove_id(id)
for id, _ in pairs(self._ids) do
self.parent:remove_id(id)
end
end

Expand Down

0 comments on commit c68b6ac

Please sign in to comment.