| 69 | } |
| 70 | |
| 71 | int StringPiece::ignore_case_compare(const StringPiece& x) const { |
| 72 | int r = memcasecmp(m_ptr, x.m_ptr, m_length < x.m_length ? m_length : x.m_length); |
| 73 | if (r != 0) |
| 74 | return r; |
| 75 | if (m_length < x.m_length) |
| 76 | return -1; |
| 77 | else if (m_length > x.m_length) |
| 78 | return 1; |
| 79 | return 0; |
| 80 | } |
| 81 | |
| 82 | bool StringPiece::ignore_case_equal(const StringPiece& other) const { |
| 83 | return size() == other.size() && memcasecmp(data(), other.data(), size()) == 0; |