Commit d053271d authored by stone4774's avatar stone4774

Use the first enum value instead of 0 in DefaultValueObjectWriter::FindEnumDefault

parent 773d8c33
...@@ -451,7 +451,7 @@ DataPiece DefaultValueObjectWriter::FindEnumDefault( ...@@ -451,7 +451,7 @@ DataPiece DefaultValueObjectWriter::FindEnumDefault(
} }
// We treat the first value as the default if none is specified. // We treat the first value as the default if none is specified.
return enum_type->enumvalue_size() > 0 return enum_type->enumvalue_size() > 0
? (use_ints_for_enums ? DataPiece(0) : DataPiece(enum_type->enumvalue(0).name(), true)) ? (use_ints_for_enums ? DataPiece(enum_type->enumvalue(0).number()) : DataPiece(enum_type->enumvalue(0).name(), true))
: DataPiece::NullData(); : DataPiece::NullData();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment