Skip to content

Commit 870ec95

Browse files
committed
optimize: fixed misuses of Lua global variables in our Lua code (caught by the new version of the lj-releng tool).
1 parent c7827e4 commit 870ec95

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

lib/ngx/errlog.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ local num_value = ffi_new("double[1]")
1818
local getfenv = getfenv
1919
local tonumber = tonumber
2020
local type = type
21+
local error = error
2122

2223

2324
local _M = { version = base.version }

lib/resty/core/base.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ end
5252
local clear_tab
5353
ok, clear_tab = pcall(require, "table.clear")
5454
if not ok then
55+
local pairs = pairs
5556
clear_tab = function (tab)
5657
for k, _ in pairs(tab) do
5758
tab[k] = nil

lib/resty/core/phase.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ local C = ffi.C
55
local FFI_ERROR = base.FFI_ERROR
66
local error = error
77
local tostring = tostring
8+
local getfenv = getfenv
89

910

1011
ffi.cdef[[

0 commit comments

Comments
 (0)