Skip to content

Commit 7d77d1b

Browse files
committed
refactor(compress) limit variable scope for readability
1 parent c322392 commit 7d77d1b

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

src/pegasus/plugins/compress.lua

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
local zlib = require "zlib"
1+
local ZlibStream = {} do
2+
local zlib = require "zlib"
23

3-
local function zlib_name(lib)
4-
if lib._VERSION and string.find(lib._VERSION, 'lua-zlib', nil, true) then
5-
return 'lua-zlib'
6-
end
4+
local function zlib_name(lib)
5+
if lib._VERSION and string.find(lib._VERSION, 'lua-zlib', nil, true) then
6+
return 'lua-zlib'
7+
end
78

8-
if lib._VERSION and string.find(lib._VERSION, 'lzlib', nil, true) then
9-
return 'lzlib'
9+
if lib._VERSION and string.find(lib._VERSION, 'lzlib', nil, true) then
10+
return 'lzlib'
11+
end
1012
end
11-
end
1213

13-
local z_lib_name = assert(zlib_name(zlib), 'Unsupported zlib Lua binding')
14+
local z_lib_name = assert(zlib_name(zlib), 'Unsupported zlib Lua binding')
15+
1416

15-
local ZlibStream = {} do
1617
ZlibStream.__index = ZlibStream
1718

1819
ZlibStream.NO_COMPRESSION = zlib.NO_COMPRESSION or 0
@@ -69,6 +70,8 @@ local ZlibStream = {} do
6970
end
7071
end
7172

73+
74+
7275
local Compress = {} do
7376
Compress.__index = Compress
7477

0 commit comments

Comments
 (0)