summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-12-09 04:22:07 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-12-09 04:22:07 +0800
commit7d024ed38ca89da57f163b54f30f0bb5c9dad8bf (patch)
tree98524e780cce736167052249df469780df672621 /script
parent7d686f320ed2dc3cb2e357375ca6c6af3dc7a962 (diff)
downloadlua-language-server-7d024ed38ca89da57f163b54f30f0bb5c9dad8bf.zip
use weak table for node cache
Diffstat (limited to 'script')
-rw-r--r--script/vm/node.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/script/vm/node.lua b/script/vm/node.lua
index 58784d24..2e408128 100644
--- a/script/vm/node.lua
+++ b/script/vm/node.lua
@@ -4,9 +4,10 @@ local vm = require 'vm.vm'
local ws = require 'workspace.workspace'
local guide = require 'parser.guide'
local timer = require 'timer'
+local util = require 'utility'
---@type table<vm.object, vm.node>
-vm.nodeCache = {}
+vm.nodeCache = setmetatable({}, util.MODE_K)
---@alias vm.node.object vm.object | vm.global