mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 12:20:41 +00:00
bugfix: don't use table.insert when nil can be insert
This commit is contained in:
@@ -63,11 +63,10 @@ redcmd[42] = function(fd, data) -- '*'
|
|||||||
for i = 1,n do
|
for i = 1,n do
|
||||||
local line = readline(fd,"\r\n")
|
local line = readline(fd,"\r\n")
|
||||||
local bytes = tonumber(string.sub(line,2))
|
local bytes = tonumber(string.sub(line,2))
|
||||||
if bytes < 0 then
|
if bytes >= 0 then
|
||||||
table.insert(bulk, nil)
|
|
||||||
else
|
|
||||||
local data = readbytes(fd, bytes + 2)
|
local data = readbytes(fd, bytes + 2)
|
||||||
table.insert(bulk, string.sub(data,1,-3))
|
-- bulk[i] = nil when bytes < 0
|
||||||
|
bulk[i] = string.sub(data,1,-3)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return true, bulk
|
return true, bulk
|
||||||
|
|||||||
Reference in New Issue
Block a user