diff options
author | stone4774 <stone4774@qq.com> | 2018-03-21 12:25:59 +0800 |
---|---|---|
committer | stone4774 <stone4774@qq.com> | 2018-03-21 12:25:59 +0800 |
commit | d053271deebe0efcd41729991b1f3d618b638ad5 (patch) | |
tree | 4d5ac57b4c124f7176b7a4e87e090be2bd09a580 /src | |
parent | 773d8c3329d1a28732d9f9c4b21c02e302052e4f (diff) |
Use the first enum value instead of 0 in DefaultValueObjectWriter::FindEnumDefault
Diffstat (limited to 'src')
-rw-r--r-- | src/google/protobuf/util/internal/default_value_objectwriter.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/google/protobuf/util/internal/default_value_objectwriter.cc b/src/google/protobuf/util/internal/default_value_objectwriter.cc index 32e2429b..032cc700 100644 --- a/src/google/protobuf/util/internal/default_value_objectwriter.cc +++ b/src/google/protobuf/util/internal/default_value_objectwriter.cc @@ -451,7 +451,7 @@ DataPiece DefaultValueObjectWriter::FindEnumDefault( } // We treat the first value as the default if none is specified. 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(); } |