Inlined for performance.
| 109 | |
| 110 | // Inlined for performance. |
| 111 | inline Status InputBuffer::ReadVarint32(uint32* result) { |
| 112 | if (pos_ + core::kMaxVarint32Bytes <= limit_) { |
| 113 | // Fast path: directly parse from buffered data. |
| 114 | // Reads strictly from the range [pos_, limit_). |
| 115 | const char* offset = core::GetVarint32Ptr(pos_, limit_, result); |
| 116 | if (offset == nullptr) return errors::OutOfRange("Parsed past limit."); |
| 117 | pos_ = const_cast<char*>(offset); |
| 118 | return Status::OK(); |
| 119 | } else { |
| 120 | return ReadVarint32Fallback(result); |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | // Inlined for performance. |
| 125 | inline Status InputBuffer::ReadVarint64(uint64* result) { |