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

Method find

base/string/string_piece.cpp:103–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103size_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
113size_type StringPiece::find(char c, size_type pos) const {
114 if (pos >= m_length)

Callers 15

HasKeyMethod · 0.80
GetMethod · 0.80
PutMethod · 0.80
InternalRemoveMethod · 0.80
UnregisterMethod · 0.80
OpenMethod · 0.80
GetFileSystemByPathMethod · 0.80
LookupMethod · 0.80
AddSSTableReaderMethod · 0.80
LoadSSTableReaderMethod · 0.80
SeekKeyMethod · 0.80
TESTFunction · 0.80

Calls

no outgoing calls

Tested by 3

TESTFunction · 0.64
TESTFunction · 0.64
TESTFunction · 0.64