mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-08-13 00:45:11 +09:00
Remove asserts the types already cover
The nil check burn down added guards which turned out redundant once the surrounding annotations landed. `_has_handlers` is set to true when the first handler registers, so it is a boolean rather than the literal false it was inferred as. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -116,7 +116,8 @@ end
|
||||
--- @param player LuaPlayer
|
||||
--- @return LuaGuiElement
|
||||
function Gui.get_top_element(define, player)
|
||||
return (assert(assert(player_elements[player.index]).top[define.name], "Element is not on the top flow"))
|
||||
local value = assert(assert(player_elements[player.index]).top[define.name], "Element is not on the top flow")
|
||||
return value
|
||||
end
|
||||
|
||||
--- Register a element define to be drawn to the left flow on join
|
||||
@@ -124,7 +125,8 @@ end
|
||||
--- @param player LuaPlayer
|
||||
--- @return LuaGuiElement
|
||||
function Gui.get_left_element(define, player)
|
||||
return (assert(assert(player_elements[player.index]).left[define.name], "Element is not on the left flow"))
|
||||
local value = assert(assert(player_elements[player.index]).left[define.name], "Element is not on the left flow")
|
||||
return value
|
||||
end
|
||||
|
||||
--- Register a element define to be drawn to the relative flow on join
|
||||
@@ -132,7 +134,8 @@ end
|
||||
--- @param player LuaPlayer
|
||||
--- @return LuaGuiElement
|
||||
function Gui.get_relative_element(define, player)
|
||||
return (assert(assert(player_elements[player.index]).relative[define.name], "Element is not on the relative flow"))
|
||||
local value = assert(assert(player_elements[player.index]).relative[define.name], "Element is not on the relative flow")
|
||||
return value
|
||||
end
|
||||
|
||||
--- Ensure all the correct elements are visible and exist
|
||||
|
||||
Reference in New Issue
Block a user