| 193 | } |
| 194 | |
| 195 | StringPiece substr(size_type pos, size_type n = npos) const { |
| 196 | if (pos > static_cast<size_type>(length_)) pos = length_; |
| 197 | if (n > length_ - pos) n = length_ - pos; |
| 198 | return StringPiece(ptr_ + pos, n); |
| 199 | } |
| 200 | |
| 201 | int Compare(const StringPiece& rhs) const { |
| 202 | const int r = memcmp(data(), rhs.data(), std::min(size(), rhs.size())); |
nothing calls this directly
no test coverage detected