Deprecate EnumVal.object (#6612)

Co-authored-by: Casper Neo <cneo@google.com>
This commit is contained in:
Casper
2021-05-13 17:57:36 -04:00
committed by GitHub
parent c121c03456
commit 04b10f5a3a
7 changed files with 73 additions and 91 deletions

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