Deprecate EnumVal.object (#6612)

Co-authored-by: Casper Neo <cneo@google.com>
This commit is contained in:
Casper
2021-05-13 14:57:36 -07:00
committed by GitHub
co-authored by Casper Neo
parent c121c03456
commit 04b10f5a3a
7 changed files with 73 additions and 91 deletions
+1 -1
View File
@@ -412,7 +412,7 @@ inline const reflection::Object &GetUnionType(
FLATBUFFERS_ASSERT(type_field);
auto union_type = GetFieldI<uint8_t>(table, *type_field);
auto enumval = enumdef->values()->LookupByKey(union_type);
return *enumval->object();
return *schema.objects()->Get(enumval->union_type()->index());
}
// Changes the contents of a string inside a FlatBuffer. FlatBuffer must