diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-03-08 15:49:16 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-03-08 15:49:16 +0800 |
commit | 94069457d8a91dc6b53850d2a4a52eaf160de955 (patch) | |
tree | ea95b222a56666265c2c521211148b8baf49bcd9 | |
parent | a16676ea0ec939c6848f88247e336223d20a2378 (diff) | |
download | lua-language-server-94069457d8a91dc6b53850d2a4a52eaf160de955.zip |
一些优化
-rw-r--r-- | server/src/vm/value.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/server/src/vm/value.lua b/server/src/vm/value.lua index d47d6c15..b520054c 100644 --- a/server/src/vm/value.lua +++ b/server/src/vm/value.lua @@ -170,6 +170,7 @@ function mt:eachChild(callback, mark, foundIndex) return method:eachChild(callback, mark, foundIndex) end +local hasSource = {} function mt:mergeValue(value) if value._type then for tp, rate in pairs(value._type) do @@ -184,7 +185,6 @@ function mt:mergeValue(value) self._child[k] = v end end - local hasSource = {} for _, info in ipairs(self) do hasSource[info.source] = true end @@ -193,6 +193,9 @@ function mt:mergeValue(value) self[#self+1] = info end end + for k in pairs(hasSource) do + hasSource[k] = nil + end if value._meta then self._meta = value._meta end |