Skip to content

Commit

Permalink
possible correction of Issue nrk#43 and change all dangerous table.in…
Browse files Browse the repository at this point in the history
…sert(table,pos,value) to table[pos] = value
  • Loading branch information
Cedric Royer authored and cedric committed Dec 29, 2015
1 parent 1d55e43 commit 8564c0b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/redis.lua
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ client_prototype.pipeline = function(client, block)
end
return function(self, ...)
local reply = cmd(client, ...)
table_insert(parsers, #requests, reply.parser)
parsers[#requests] = reply.parser
return reply
end
end
Expand All @@ -480,7 +480,7 @@ client_prototype.pipeline = function(client, block)
if parser then
reply = parser(reply)
end
table_insert(replies, i, reply)
replies[i] = reply
end

return replies, #requests
Expand Down Expand Up @@ -661,9 +661,8 @@ do
end
end

local table_insert = table.insert
for i, parser in pairs(queued_parsers) do
table_insert(replies, i, parser(raw_replies[i]))
replies[i] = parser(raw_replies[i])
end

return replies, #queued_parsers
Expand Down

0 comments on commit 8564c0b

Please sign in to comment.