Inlined for performance.
| 123 | |
| 124 | // Inlined for performance. |
| 125 | inline Status InputBuffer::ReadVarint64(uint64* result) { |
| 126 | if (pos_ + core::kMaxVarint64Bytes <= limit_) { |
| 127 | // Fast path: directly parse from buffered data. |
| 128 | // Reads strictly from the range [pos_, limit_). |
| 129 | const char* offset = core::GetVarint64Ptr(pos_, limit_, result); |
| 130 | if (offset == nullptr) return errors::OutOfRange("Parsed past limit."); |
| 131 | pos_ = const_cast<char*>(offset); |
| 132 | return Status::OK(); |
| 133 | } else { |
| 134 | return ReadVarint64Fallback(result); |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | } // namespace io |
| 139 | } // namespace tensorflow |