From 9db5b11c9cf2922435b53495b9c1e114525f0428 Mon Sep 17 00:00:00 2001 From: Chris Kennelly Date: Tue, 24 Jan 2017 17:37:33 -0800 Subject: Work with truncated tag numbers. This allows more compact comparisons (1 byte instead of 4 byte immediates on x86) for each possible wire/tag inside each field. --- src/google/protobuf/timestamp.pb.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/google/protobuf/timestamp.pb.cc') diff --git a/src/google/protobuf/timestamp.pb.cc b/src/google/protobuf/timestamp.pb.cc index c7a1179a..e21117b6 100644 --- a/src/google/protobuf/timestamp.pb.cc +++ b/src/google/protobuf/timestamp.pb.cc @@ -216,7 +216,8 @@ bool Timestamp::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // int64 seconds = 1; case 1: { - if (tag == 8u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(8u)) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( @@ -229,7 +230,8 @@ bool Timestamp::MergePartialFromCodedStream( // int32 nanos = 2; case 2: { - if (tag == 16u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(16u)) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( -- cgit v1.2.3