From 8564c0bd2c22d6b47a22afbb54d23b090d2ced97 Mon Sep 17 00:00:00 2001 From: Cedric Royer Date: Tue, 29 Dec 2015 11:06:56 +0000 Subject: [PATCH] possible correction of Issue #43 and change all dangerous table.insert(table,pos,value) to table[pos] = value --- src/redis.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/redis.lua b/src/redis.lua index 622608c..c0ccaf1 100644 --- a/src/redis.lua +++ b/src/redis.lua @@ -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 @@ -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 @@ -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