From 3e516dd717440cad6fce8731a2b627abc6335bbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 31 Mar 2022 20:17:15 +0800 Subject: cleanup --- script/vm/infer.lua | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'script/vm/infer.lua') diff --git a/script/vm/infer.lua b/script/vm/infer.lua index 5ac7d73b..6457696a 100644 --- a/script/vm/infer.lua +++ b/script/vm/infer.lua @@ -17,7 +17,7 @@ local inferSorted = { ['nil'] = 100, } -local viewNodeMap = util.switch() +local viewNodeSwitch = util.switch() : case 'nil' : case 'boolean' : case 'string' @@ -112,14 +112,11 @@ local viewNodeMap = util.switch() end return ('fun(%s)%s'):format(argView, regView) end) - : getMap() ---@param node vm.node ---@return string? local function viewNode(node, options) - if viewNodeMap[node.type] then - return viewNodeMap[node.type](node, options) - end + return viewNodeSwitch(node.type, node, options) end local function eraseAlias(node, viewMap, options) -- cgit v1.2.3