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