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

Method starts_with

base/string/string_piece.cpp:87–89  ·  view source on GitHub ↗

Does "this" start with "x"

Source from the content-addressed store, hash-verified

85
86// Does "this" start with "x"
87bool StringPiece::starts_with(const StringPiece& x) const {
88 return ((m_length >= x.m_length) && MemoryEqual(m_ptr, x.m_ptr, x.m_length));
89}
90
91// Does "this" end with "x"
92bool StringPiece::ends_with(const StringPiece& x) const {

Callers 3

StringStartsWithFunction · 0.80
TESTFunction · 0.80
ParseVersionMethod · 0.80

Calls 1

MemoryEqualFunction · 0.85

Tested by 1

TESTFunction · 0.64