Skip to content

Commit

Permalink
Fix warnings about global and unused variables
Browse files Browse the repository at this point in the history
Signed-off-by: Yan Minari <yangm97@gmail.com>
  • Loading branch information
yangm97 committed Mar 31, 2019
1 parent c6f3a03 commit e16288b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lua/vendor/ltn12.lua
Expand Up @@ -12,18 +12,18 @@ local table = require("table")
local unpack = unpack or table.unpack
local base = _G
local _M = {}
if module then -- heuristic for exporting a global package table
ltn12 = _M
end
-- if module then -- heuristic for exporting a global package table
-- ltn12 = _M
-- end
local filter,source,sink,pump = {},{},{},{}

_M.filter = filter
_M.source = source
_M.sink = sink
_M.pump = pump

local unpack = unpack or table.unpack
local select = base.select
-- local unpack = unpack or table.unpack
-- local select = base.select

-- 2048 seems to be better in windows...
_M.BLOCKSIZE = 2048
Expand Down Expand Up @@ -224,7 +224,7 @@ end
-- creates a sink that stores into a table
function sink.table(t)
t = t or {}
local f = function(chunk, err)
local f = function(chunk, _)
if chunk then table.insert(t, chunk) end
return 1
end
Expand All @@ -245,7 +245,7 @@ end
-- creates a file sink
function sink.file(handle, io_err)
if handle then
return function(chunk, err)
return function(chunk, _)
if not chunk then
handle:close()
return 1
Expand Down

0 comments on commit e16288b

Please sign in to comment.