aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordavid <57832272+jyoui@users.noreply.github.com>2022-02-01 15:40:35 +0900
committerThijs Schreijer <thijs@thijsschreijer.nl>2022-03-21 11:07:26 +0100
commit46ecb7e2dc3dd92931c6d9d99fdc9260e83077ff (patch)
treea276f74a322488cdf761740c118626c8373cc44f /src
parenta36818d3f3afd8758ec10991a5cb08ebdaca6329 (diff)
downloadluasocket-46ecb7e2dc3dd92931c6d9d99fdc9260e83077ff.tar.gz
luasocket-46ecb7e2dc3dd92931c6d9d99fdc9260e83077ff.tar.bz2
luasocket-46ecb7e2dc3dd92931c6d9d99fdc9260e83077ff.zip
src/ltn12.lua: remove duplicated codes
Diffstat (limited to 'src')
-rw-r--r--src/ltn12.lua6
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")
11local table = require("table") 11local table = require("table")
12local unpack = unpack or table.unpack 12local unpack = unpack or table.unpack
13local base = _G 13local base = _G
14local select = select
15
14local _M = {} 16local _M = {}
15if module then -- heuristic for exporting a global package table 17if 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
25local 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)
46function filter.chain(...) 46function 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)