| 829 | } |
| 830 | |
| 831 | inline bool CodedInputStream::ExpectTag(uint32 expected) { |
| 832 | if (expected < (1 << 7)) { |
| 833 | if (GOOGLE_PREDICT_TRUE(buffer_ < buffer_end_) && buffer_[0] == expected) { |
| 834 | Advance(1); |
| 835 | return true; |
| 836 | } else { |
| 837 | return false; |
| 838 | } |
| 839 | } else if (expected < (1 << 14)) { |
| 840 | if (GOOGLE_PREDICT_TRUE(BufferSize() >= 2) && |
| 841 | buffer_[0] == static_cast<uint8>(expected | 0x80) && |
| 842 | buffer_[1] == static_cast<uint8>(expected >> 7)) { |
| 843 | Advance(2); |
| 844 | return true; |
| 845 | } else { |
| 846 | return false; |
| 847 | } |
| 848 | } else { |
| 849 | // Don't bother optimizing for larger values. |
| 850 | return false; |
| 851 | } |
| 852 | } |
| 853 | |
| 854 | inline const uint8* CodedInputStream::ExpectTagFromArray( |
| 855 | const uint8* buffer, uint32 expected) { |
no outgoing calls
no test coverage detected