Skip to content

Commit

Permalink
Fixed array call implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
tredfern committed Feb 12, 2022
1 parent 4cc88bf commit 70b0a5c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions moonpie/collections/array.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ local Array = Class("moonpie.collections.Array")

function Array:initialize(dimensions)
self.dimensions = dimensions
local mt = getmetatable(self)
mt.__call = Array.call
end

function Array:ensureElement(args)
Expand Down Expand Up @@ -39,7 +37,7 @@ function Array:set(args)
v[args[self.dimensions]] = value
end

function Array:call(...)
function Array:__call(...)
-- get the values
local args = tables.pack(...)
self:ensureElement(args)
Expand All @@ -51,5 +49,4 @@ function Array:call(...)
end
end


return Array

0 comments on commit 70b0a5c

Please sign in to comment.