perf: XML encode (name cache, escape fast path, indent cache, no key list for attribute-less elements), Types.object shares one empty key list until set, rbxm column type check
This commit is contained in:
1 parent
0ec772ee30
commit
7947dd7f3b
3 files changed
+63
-19
No files matched your search
@@ -244,12 +244,13 @@ function Rbxm.decode(r: Bytes.Reader, opts: DecodeOptions?): (Rbx.Tree?, Err.Err
|
||||
local vals, msg = Binary.decode(t, body, q + 1, be, n, ctx)
|
||||
if vals then
|
||||
local tname = Rbx.TYPE_NAMES[t]
|
||||
for i, ref in cls.refs do
|
||||
local inst = byRef[ref]
|
||||
if pname == "Name" and t == 0x01 then
|
||||
inst.name = vals[i]
|
||||
else
|
||||
inst.properties[pname] = { type = tname, value = vals[i] }
|
||||
if pname == "Name" and t == 0x01 then
|
||||
for i, ref in cls.refs do
|
||||
byRef[ref].name = vals[i]
|
||||
end
|
||||
else
|
||||
for i, ref in cls.refs do
|
||||
byRef[ref].properties[pname] = { type = tname, value = vals[i] }
|
||||
end
|
||||
end
|
||||
elseif msg == "unknown" then
|
||||
@@ -322,7 +323,7 @@ local function columnType(insts: { Rbx.Instance }, pname: string): (number?, str
|
||||
local id, tname = nil, nil
|
||||
for _, inst in insts do
|
||||
local v = inst.properties[pname]
|
||||
if v then
|
||||
if v and (type(v) ~= "table" or tname == nil or v.type ~= tname) then
|
||||
if type(v) ~= "table" or type(v.type) ~= "string" then
|
||||
return nil, "property " .. pname .. " of " .. inst.className .. " is not a { type, value } table"
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user