diff options
| author | david <57832272+jyoui@users.noreply.github.com> | 2022-02-01 15:40:35 +0900 |
|---|---|---|
| committer | Thijs Schreijer <thijs@thijsschreijer.nl> | 2022-03-21 11:07:26 +0100 |
| commit | 46ecb7e2dc3dd92931c6d9d99fdc9260e83077ff (patch) | |
| tree | a276f74a322488cdf761740c118626c8373cc44f | |
| parent | a36818d3f3afd8758ec10991a5cb08ebdaca6329 (diff) | |
| download | luasocket-46ecb7e2dc3dd92931c6d9d99fdc9260e83077ff.tar.gz luasocket-46ecb7e2dc3dd92931c6d9d99fdc9260e83077ff.tar.bz2 luasocket-46ecb7e2dc3dd92931c6d9d99fdc9260e83077ff.zip | |
src/ltn12.lua: remove duplicated codes
| -rw-r--r-- | src/ltn12.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ltn12.lua b/src/ltn12.lua index f1e05e1..4cb17f5 100644 --- a/src/ltn12.lua +++ b/src/ltn12.lua | |||
| @@ -11,6 +11,8 @@ local string = require("string") | |||
| 11 | local table = require("table") | 11 | local table = require("table") |
| 12 | local unpack = unpack or table.unpack | 12 | local unpack = unpack or table.unpack |
| 13 | local base = _G | 13 | local base = _G |
| 14 | local select = select | ||
| 15 | |||
| 14 | local _M = {} | 16 | local _M = {} |
| 15 | if module then -- heuristic for exporting a global package table | 17 | if module then -- heuristic for exporting a global package table |
| 16 | ltn12 = _M -- luacheck: ignore | 18 | ltn12 = _M -- luacheck: ignore |
| @@ -22,8 +24,6 @@ _M.source = source | |||
| 22 | _M.sink = sink | 24 | _M.sink = sink |
| 23 | _M.pump = pump | 25 | _M.pump = pump |
| 24 | 26 | ||
| 25 | local unpack = unpack or table.unpack | ||
| 26 | |||
| 27 | -- 2048 seems to be better in windows... | 27 | -- 2048 seems to be better in windows... |
| 28 | _M.BLOCKSIZE = 2048 | 28 | _M.BLOCKSIZE = 2048 |
| 29 | _M._VERSION = "LTN12 1.0.3" | 29 | _M._VERSION = "LTN12 1.0.3" |
| @@ -45,7 +45,7 @@ end | |||
| 45 | -- (thanks to Wim Couwenberg) | 45 | -- (thanks to Wim Couwenberg) |
| 46 | function filter.chain(...) | 46 | function filter.chain(...) |
| 47 | local arg = {...} | 47 | local arg = {...} |
| 48 | local n = base.select('#',...) | 48 | local n = select('#',...) |
| 49 | local top, index = 1, 1 | 49 | local top, index = 1, 1 |
| 50 | local retry = "" | 50 | local retry = "" |
| 51 | return function(chunk) | 51 | return function(chunk) |
