mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-03 20:31:23 +00:00
[Lua] GetRootAs can accept strings. Made Luatest Benchmarks optional (#6593)
This commit is contained in:
@@ -13,6 +13,9 @@ function Referrable.New()
|
||||
return o
|
||||
end
|
||||
function Referrable.GetRootAsReferrable(buf, offset)
|
||||
if type(buf) == "string" then
|
||||
buf = flatbuffers.binaryArray.New(buf)
|
||||
end
|
||||
local n = flatbuffers.N.UOffsetT:Unpack(buf, offset)
|
||||
local o = Referrable.New()
|
||||
o:Init(buf, n + offset)
|
||||
|
||||
Reference in New Issue
Block a user