Skip to content

Commit de82ae3

Browse files
committed
Switch to requires_utf8_validation
descriptor()->file()->syntax() will be private soon.
1 parent 50ef915 commit de82ae3

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/field_instance.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,7 @@ class ConstFieldInstance {
190190
return descriptor_->message_type();
191191
}
192192

193-
bool EnforceUtf8() const {
194-
return descriptor_->type() == protobuf::FieldDescriptor::TYPE_STRING &&
195-
descriptor()->file()->syntax() ==
196-
protobuf::FileDescriptor::SYNTAX_PROTO3;
197-
}
193+
bool EnforceUtf8() const { return descriptor_->requires_utf8_validation(); }
198194

199195
const protobuf::FieldDescriptor* descriptor() const { return descriptor_; }
200196

0 commit comments

Comments
 (0)