summaryrefslogtreecommitdiff
path: root/server-beta/src/core/setfield.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-10-14 21:03:49 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-10-14 21:03:49 +0800
commit9c18872bc69a713c038eb9626d42a81615b80d97 (patch)
treefc87529a26f2f1ab7f101809b0581e01662cfb0c /server-beta/src/core/setfield.lua
parent64bcf0979e681f8c2f521642cf648dbf88f360a9 (diff)
downloadlua-language-server-9c18872bc69a713c038eb9626d42a81615b80d97.zip
整理代码
Diffstat (limited to 'server-beta/src/core/setfield.lua')
-rw-r--r--server-beta/src/core/setfield.lua26
1 files changed, 10 insertions, 16 deletions
diff --git a/server-beta/src/core/setfield.lua b/server-beta/src/core/setfield.lua
index 356b5eee..a9f76280 100644
--- a/server-beta/src/core/setfield.lua
+++ b/server-beta/src/core/setfield.lua
@@ -16,33 +16,27 @@ function m:field(source, key, callback)
callback(source.field, 'set')
end
- self:eachField(node, myKey, function (src, mode)
+ self:eachField(node, key, function (src, mode)
if used[src] then
return
end
used[src] = true
- self:eachField(src, key, function (src, mode)
- used[src] = true
- if mode == 'set' then
- callback(src, mode)
- found = true
- end
- end)
+ if mode == 'set' then
+ callback(src, mode)
+ found = true
+ end
end)
self:eachValue(node, function (src)
- self:eachField(src, myKey, function (src, mode)
+ self:eachField(src, key, function (src, mode)
if used[src] then
return
end
used[src] = true
- self:eachField(src, key, function (src, mode)
- used[src] = true
- if mode == 'set' then
- callback(src, mode)
- found = true
- end
- end)
+ if mode == 'set' then
+ callback(src, mode)
+ found = true
+ end
end)
end)