| 101 | } |
| 102 | |
| 103 | size_type StringPiece::find(const StringPiece& s, size_type pos) const { |
| 104 | if (pos > m_length) |
| 105 | return npos; |
| 106 | |
| 107 | const char* result = std::search(m_ptr + pos, m_ptr + m_length, |
| 108 | s.m_ptr, s.m_ptr + s.m_length); |
| 109 | const size_type xpos = result - m_ptr; |
| 110 | return xpos + s.m_length <= m_length ? xpos : npos; |
| 111 | } |
| 112 | |
| 113 | size_type StringPiece::find(char c, size_type pos) const { |
| 114 | if (pos >= m_length) |
no outgoing calls