Made "field set more than once" check in JSON parser faster.

Change-Id: I3ecc1aa610526c270faa56cc5266f14cd81db247
Tested: on Linux.
This commit is contained in:
Wouter van Oortmerssen
2014-09-04 11:57:09 -07:00
parent ea57dfe897
commit 11f2538610
3 changed files with 14 additions and 7 deletions

View File

@@ -176,11 +176,12 @@ struct Definition {
};
struct FieldDef : public Definition {
FieldDef() : deprecated(false), padding(0) {}
FieldDef() : deprecated(false), padding(0), used(false) {}
Value value;
bool deprecated;
size_t padding; // bytes to always pad after this field
size_t padding; // Bytes to always pad after this field.
bool used; // Used during JSON parsing to check for repeated fields.
};
struct StructDef : public Definition {