MCPcopy Create free account
hub / github.com/Snapchat/Valdi / hasSuffix

Function hasSuffix

valdi_core/src/valdi_core/cpp/Attributes/AttributeUtils.cpp:185–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183}
184
185bool hasSuffix(const std::string_view& str, const char* term) {
186 auto termLength = strlen(term);
187 if (termLength > str.size()) {
188 return false;
189 }
190
191 return str.compare(str.size() - termLength, termLength, term) == 0;
192}
193
194} // namespace Valdi

Callers 2

hasSuffixMethod · 0.85
trimmedMethod · 0.85

Calls 2

compareMethod · 0.65
sizeMethod · 0.45

Tested by

no test coverage detected