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

Function ConsumeSuffix

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

Source from the content-addressed store, hash-verified

128}
129
130bool ConsumeSuffix(LiteString* s, LiteString expected) {
131 if (s->ends_with(expected)) {
132 s->remove_suffix(expected.size());
133 return true;
134 }
135 return false;
136}
137
138bool StartWith(const std::string& s, const std::string& pattern) {
139 if (s.size() < pattern.size()) {

Callers

nothing calls this directly

Calls 3

ends_withMethod · 0.80
remove_suffixMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected