MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / endsWith

Method endsWith

source/core/StarStringView.cpp:90–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90bool StringView::endsWith(StringView end, CaseSensitivity cs) const {
91 auto endsize = end.size();
92 if (endsize == 0)
93 return true;
94
95 auto mysize = size();
96 if (endsize > mysize)
97 return false;
98
99 return compare(mysize - endsize, NPos, end, 0, NPos, cs) == 0;
100}
101bool StringView::endsWith(Char end, CaseSensitivity cs) const {
102 if (m_view.empty())
103 return false;

Callers

nothing calls this directly

Calls 4

sizeFunction · 0.85
compareFunction · 0.85
sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected