MCPcopy Create free account
hub / github.com/chen3feng/toft / ignore_case_compare

Method ignore_case_compare

base/string/string_piece.cpp:71–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71int 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
82bool StringPiece::ignore_case_equal(const StringPiece& other) const {
83 return size() == other.size() && memcasecmp(data(), other.data(), size()) == 0;

Callers 2

CompareStringIgnoreCaseFunction · 0.80
TESTFunction · 0.80

Calls 1

memcasecmpFunction · 0.85

Tested by 1

TESTFunction · 0.64