Skip to content

Commit

Permalink
No need to double check "timeout".
Browse files Browse the repository at this point in the history
tonumber() returns nil on nil or invalid values anyway.
  • Loading branch information
nrk committed Jul 23, 2012
1 parent 8d54b51 commit 96e7f3f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/redis.lua
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ function redis.connect(...)
end
elseif #args > 1 then
local host, port, timeout = unpack(args)
parameters = { host = host, port = port, timeout = timeout and tonumber(timeout) }
parameters = { host = host, port = port, timeout = tonumber(timeout) }
end

local commands = redis.commands or {}
Expand Down

0 comments on commit 96e7f3f

Please sign in to comment.