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

Method ends_with

base/string/string_piece.cpp:92–95  ·  view source on GitHub ↗

Does "this" end with "x"

Source from the content-addressed store, hash-verified

90
91// Does "this" end with "x"
92bool StringPiece::ends_with(const StringPiece& x) const {
93 return ((m_length >= x.m_length) &&
94 (MemoryEqual(m_ptr + m_length - x.m_length, x.m_ptr, x.m_length)));
95}
96
97size_type StringPiece::copy(char* buf, size_type n, size_type pos) const {
98 size_type ret = std::min(m_length - pos, n);

Callers 2

StringEndsWithFunction · 0.80
TESTFunction · 0.80

Calls 1

MemoryEqualFunction · 0.85

Tested by 1

TESTFunction · 0.64