diff options
Diffstat (limited to 'server/src/core')
-rw-r--r-- | server/src/core/vm.lua | 82 |
1 files changed, 0 insertions, 82 deletions
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') |