diff options
author | Chris Kennelly <ckennelly@google.com> | 2017-01-24 17:37:33 -0800 |
---|---|---|
committer | Chris Kennelly <ckennelly@google.com> | 2017-02-15 11:39:39 -0800 |
commit | 9db5b11c9cf2922435b53495b9c1e114525f0428 (patch) | |
tree | be2e4da2021e6d25558ec2595f615724d9839781 /src/google/protobuf/api.pb.cc | |
parent | 0026dff9f6e7fbea541fd293cbf8ebcd254e374d (diff) | |
download | protobuf-9db5b11c9cf2922435b53495b9c1e114525f0428.tar.gz protobuf-9db5b11c9cf2922435b53495b9c1e114525f0428.tar.bz2 protobuf-9db5b11c9cf2922435b53495b9c1e114525f0428.zip |
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.
Diffstat (limited to 'src/google/protobuf/api.pb.cc')
-rw-r--r-- | src/google/protobuf/api.pb.cc | 48 |
1 files changed, 32 insertions, 16 deletions
diff --git a/src/google/protobuf/api.pb.cc b/src/google/protobuf/api.pb.cc index 24275722..7965d1ce 100644 --- a/src/google/protobuf/api.pb.cc +++ b/src/google/protobuf/api.pb.cc @@ -288,7 +288,8 @@ bool Api::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // string name = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -303,7 +304,8 @@ bool Api::MergePartialFromCodedStream( // repeated .google.protobuf.Method methods = 2; case 2: { - if (tag == 18u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_methods())); @@ -316,7 +318,8 @@ bool Api::MergePartialFromCodedStream( // repeated .google.protobuf.Option options = 3; case 3: { - if (tag == 26u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(26u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_options())); @@ -329,7 +332,8 @@ bool Api::MergePartialFromCodedStream( // string version = 4; case 4: { - if (tag == 34u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(34u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_version())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -344,7 +348,8 @@ bool Api::MergePartialFromCodedStream( // .google.protobuf.SourceContext source_context = 5; case 5: { - if (tag == 42u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(42u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_source_context())); } else { @@ -355,7 +360,8 @@ bool Api::MergePartialFromCodedStream( // repeated .google.protobuf.Mixin mixins = 6; case 6: { - if (tag == 50u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(50u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_mixins())); @@ -368,7 +374,8 @@ bool Api::MergePartialFromCodedStream( // .google.protobuf.Syntax syntax = 7; case 7: { - if (tag == 56u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(56u)) { int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( @@ -1029,7 +1036,8 @@ bool Method::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // string name = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -1044,7 +1052,8 @@ bool Method::MergePartialFromCodedStream( // string request_type_url = 2; case 2: { - if (tag == 18u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_request_type_url())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -1059,7 +1068,8 @@ bool Method::MergePartialFromCodedStream( // bool request_streaming = 3; case 3: { - if (tag == 24u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(24u)) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( @@ -1072,7 +1082,8 @@ bool Method::MergePartialFromCodedStream( // string response_type_url = 4; case 4: { - if (tag == 34u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(34u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_response_type_url())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -1087,7 +1098,8 @@ bool Method::MergePartialFromCodedStream( // bool response_streaming = 5; case 5: { - if (tag == 40u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(40u)) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( @@ -1100,7 +1112,8 @@ bool Method::MergePartialFromCodedStream( // repeated .google.protobuf.Option options = 6; case 6: { - if (tag == 50u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(50u)) { DO_(input->IncrementRecursionDepth()); DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( input, add_options())); @@ -1113,7 +1126,8 @@ bool Method::MergePartialFromCodedStream( // .google.protobuf.Syntax syntax = 7; case 7: { - if (tag == 56u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(56u)) { int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( @@ -1729,7 +1743,8 @@ bool Mixin::MergePartialFromCodedStream( switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // string name = 1; case 1: { - if (tag == 10u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -1744,7 +1759,8 @@ bool Mixin::MergePartialFromCodedStream( // string root = 2; case 2: { - if (tag == 18u) { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_root())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( |