From 70e4776a011ce894d9aedafc4108d9e175f41b80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 29 Jan 2019 09:51:42 +0800 Subject: =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=B2=A1=E7=94=A8=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/core/vm.lua | 82 -------------------------------------------------- 1 file changed, 82 deletions(-) (limited to 'server/src') diff --git a/server/src/core/vm.lua b/server/src/core/vm.lua index 98778e49..004e40f9 100644 --- a/server/src/core/vm.lua +++ b/server/src/core/vm.lua @@ -241,88 +241,6 @@ function mt:buildTable(source) return tbl end -function mt:mergeValue(a, b, mark) - if a == b then - return - end - if not mark then - mark = {} - end - if mark[a] or mark[b] then - return - end - if a.uri ~= self.uri then - return - end - mark[a] = true - mark[b] = true - self:mergeChild(a, b, mark) - for k in pairs(a) do - a[k] = nil - end - for k, v in pairs(b) do - a[k] = v - end -end - -function mt:mergeField(a, b, mark) - if a == b then - return - end - if not mark then - mark = {} - end - for i, info in ipairs(a) do - a[i] = nil - b[#b+1] = info - end - for i, v in ipairs(b) do - a[i] = v - end - self:mergeValue(a:getValue(), b:getValue(), mark) -end - -function mt:mergeChild(a, b, mark) - if a == b then - return - end - if not a.child and not b.child then - return - end - if not mark then - mark = {} - end - if a.uri ~= self.uri then - return - end - if b.uri == self.uri then - local child = a.child or orderTable() - local other = b.child or orderTable() - a.child = nil - b.child = nil - for k, v in pairs(other) do - if child[k] then - self:mergeField(child[k], v, mark) - else - child[k] = v - end - end - a.child = child - b.child = child - else - local child = a.child or orderTable() - local other = b.child - if not other then - return - end - a.child = nil - for k, v in pairs(other) do - child[k] = v - end - a.child = child - end -end - function mt:setValue(var, value, source) if value and value.type == 'list' then error('Cant set value list') -- cgit v1.2.3