Clear the last of the nil checks

Guards now cover the statements that follow them, and a couple of reads
are restructured so the narrowing survives.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
bbassie
2026-08-07 15:31:43 +00:00
co-authored by Claude Opus 5
parent 76ecc37d3f
commit f5656025ee
9 changed files with 31 additions and 22 deletions
+7 -5
View File
@@ -14,7 +14,8 @@ end
]]
local ext, var
local ext --- @type table<string, any>
local var --- @type table<string, any>
local concat = table.concat
local External = {}
@@ -29,12 +30,13 @@ end
]]
function External.valid()
if storage.ext == nil then return false end
if ext == storage.ext and var == ext.var then
local stored = storage.ext
if stored == nil then return false end
if ext == stored and var == ext.var then
return var ~= nil
else
ext = storage.ext
var = ext.var
ext = stored
var = stored.var
return var ~= nil
end
end