mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-27 08:12:18 +00:00
Fixed JSON text output not finding symbolic names for enum value 1.
Change-Id: If3a062926dd86b95fa68ed64fc7ee2de7bc0d930 Tested: on Linux
This commit is contained in:
@@ -235,7 +235,8 @@ struct EnumDef : public Definition {
|
|||||||
EnumDef() : is_union(false) {}
|
EnumDef() : is_union(false) {}
|
||||||
|
|
||||||
EnumVal *ReverseLookup(int enum_idx) {
|
EnumVal *ReverseLookup(int enum_idx) {
|
||||||
for (auto it = vals.vec.begin() + 1; it != vals.vec.end(); ++it) {
|
for (auto it = vals.vec.begin() + static_cast<int>(is_union);
|
||||||
|
it != vals.vec.end(); ++it) {
|
||||||
if ((*it)->value == enum_idx) {
|
if ((*it)->value == enum_idx) {
|
||||||
return *it;
|
return *it;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user