luci-base: luci.util: rewrite threadlocal code to not confuse minifier
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
This commit is contained in:
parent
1bb4822dca
commit
fa84ca05d5
1 changed files with 3 additions and 2 deletions
|
@ -125,10 +125,11 @@ local tl_meta = {
|
||||||
|
|
||||||
__newindex = function(self, key, value)
|
__newindex = function(self, key, value)
|
||||||
local c = coxpt[coroutine.running()] or coroutine.running() or 0
|
local c = coxpt[coroutine.running()] or coroutine.running() or 0
|
||||||
if not rawget(self, c) then
|
local r = rawget(self, c)
|
||||||
|
if not r then
|
||||||
rawset(self, c, { [key] = value })
|
rawset(self, c, { [key] = value })
|
||||||
else
|
else
|
||||||
rawget(self, c)[key] = value
|
r[key] = value
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue