| 66 | } |
| 67 | |
| 68 | int StringPiece::find(StringPiece s, size_type pos) const { |
| 69 | if (length_ <= 0 || pos > static_cast<size_type>(length_)) { |
| 70 | if (length_ == 0 && pos == 0 && s.length_ == 0) return 0; |
| 71 | return npos; |
| 72 | } |
| 73 | const char *result = memmatch(ptr_ + pos, length_ - pos, |
| 74 | s.ptr_, s.length_); |
| 75 | return result ? result - ptr_ : npos; |
| 76 | } |
| 77 | |
| 78 | int StringPiece::find(char c, size_type pos) const { |
| 79 | if (length_ <= 0 || pos >= static_cast<size_type>(length_)) { |