Skip to content

Commit af3bb18

Browse files
committed
Don't use syntax()
1 parent dbe588b commit af3bb18

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/mutator.cc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,7 @@ bool GetRandomBool(RandomEngine* random, size_t n = 2) {
8787
}
8888

8989
bool IsProto3SimpleField(const FieldDescriptor& field) {
90-
assert(field.file()->syntax() == FileDescriptor::SYNTAX_PROTO3 ||
91-
field.file()->syntax() == FileDescriptor::SYNTAX_PROTO2);
92-
return field.file()->syntax() == FileDescriptor::SYNTAX_PROTO3 &&
93-
field.cpp_type() != FieldDescriptor::CPPTYPE_MESSAGE &&
94-
!field.containing_oneof() && !field.is_repeated();
90+
return !field.is_repeated() && !field.has_presence();
9591
}
9692

9793
struct CreateDefaultField : public FieldFunction<CreateDefaultField> {

0 commit comments

Comments
 (0)