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

Method rfind

graphlearn/src/common/string/lite_string.cc:44–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44size_t LiteString::rfind(char c, size_t pos) const {
45 if (size_ == 0) {
46 return npos;
47 }
48
49 const char* p = data_ + std::min(pos, size_ - 1);
50 for (; p >= data_; p--) {
51 if (*p == c) {
52 return p - data_;
53 }
54 }
55 return npos;
56}
57
58LiteString LiteString::substr(size_t pos, size_t n) const {
59 if (pos > size_) {

Callers 7

BaseNameFunction · 0.80
StartsWithFunction · 0.80
CheckSpacingFunction · 0.80
CheckTrailingSemicolonFunction · 0.80
ProcessFileFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected