Small improvements to the C++ API.

Change-Id: Ib30ffbbd140a8b82fe664129fa4e8c55836267f8
Tested: on Linux.
This commit is contained in:
Wouter van Oortmerssen
2015-06-17 16:56:50 -07:00
parent 576022c64b
commit c967515da5
4 changed files with 16 additions and 5 deletions

View File

@@ -313,7 +313,7 @@ class ResizeContext {
auto enumdef = schema_.enums()->Get(fielddef->type()->index());
// TODO: this is clumsy and slow, but no other way to find it?
auto type_field = fielddefs->LookupByKey(
(fielddef->name()->c_str() + std::string("_type")).c_str());
(fielddef->name()->str() + "_type").c_str());
assert(type_field);
auto union_type = GetFieldI<uint8_t>(table, type_field);
auto enumval = enumdef->values()->LookupByKey(union_type);