Replies: 5 comments
-
我在proto中定义了一个字段类型为map<int32, bool>,从pb decode成table时,map会被翻译成一个数组,{1:true} -> [true] |
Beta Was this translation helpful? Give feedback.
-
Lua里面table本来就同时是map和array |
Beta Was this translation helpful? Give feedback.
-
【Lua里面table本来就同时是map和array】,嗯嗯,之前想到是这个原因导致的,主要是想看看有没有啥方法可以保留这个type信息,貌似只要经过lua这一层变成数组,key就找不回来了,貌似不可行。 |
Beta Was this translation helpful? Give feedback.
-
其实你直接把table当map然后pairs就行了,你不需要关心它到底具体是什么的。
averyboy ***@***.***>于2021年8月9日 周一17:06写道:
【Lua里面table本来就同时是map和array】,嗯嗯,之前想到是这个原因导致的,主要是想看看有没有啥方法可以保留这个type信息,貌似只要经过lua这一层变成数组,key就找不回来了,貌似不可行。
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#153 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA36MZ2MQF2RLS6RC6UUOLT36K7VANCNFSM5BO3OLEA>
.
--
regards,
Xavier Wang.
|
Beta Was this translation helpful? Give feedback.
-
ok,我看看这里怎么修改下,谢谢starwing |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
All reactions