MCPcopy Create free account
hub / github.com/alibaba/graph-learn / EndWith

Function EndWith

graphlearn/src/common/string/string_tool.cc:150–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148}
149
150bool EndWith(const std::string& s, const std::string& pattern) {
151 if (s.size() < pattern.size()) {
152 return false;
153 }
154 const char* cs = &(s.back());
155 const char* cp = &(pattern.back());
156 for (size_t i = 0; i < pattern.size(); ++i, --cs, --cp) {
157 if ((*cs) != *(cp)) {
158 return false;
159 }
160 }
161 return true;
162}
163
164std::string Join(const std::vector<std::string>& v,
165 LiteString delim,

Callers 1

IsDirectoryMethod · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected