diff --git a/base.lua b/base.lua index 73cc977..f77a13c 100644 --- a/base.lua +++ b/base.lua @@ -31,9 +31,9 @@ QlessRecurringJob.__index = QlessRecurringJob Qless.config = {} -- Extend a table. This comes up quite frequently -function table.extend(self, other) +local function extend_table(target, other) for i, v in ipairs(other) do - table.insert(self, v) + table.insert(target, v) end end diff --git a/queue.lua b/queue.lua index 04e8497..370cdfd 100644 --- a/queue.lua +++ b/queue.lua @@ -247,7 +247,7 @@ function QlessQueue:peek(now, count) -- With these in place, we can expand this list of jids based on the work -- queue itself and the priorities therein - table.extend(jids, self.work.peek(count - #jids)) + extend_table(jids, self.work.peek(count - #jids)) return jids end @@ -322,7 +322,7 @@ function QlessQueue:pop(now, worker, count) -- With these in place, we can expand this list of jids based on the work -- queue itself and the priorities therein - table.extend(jids, self.work.peek(count - #jids)) + extend_table(jids, self.work.peek(count - #jids)) local state for index, jid in ipairs(jids) do