MCPcopy Create free account
hub / github.com/apache/brpc / endsWith

Function endsWith

test/brpc_controller_unittest.cpp:79–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77#if ! BRPC_WITH_GLOG
78
79static bool endsWith(const std::string& s1, const butil::StringPiece& s2) {
80 if (s1.size() < s2.size()) {
81 return false;
82 }
83 return memcmp(s1.data() + s1.size() - s2.size(), s2.data(), s2.size()) == 0;
84}
85static bool startsWith(const std::string& s1, const butil::StringPiece& s2) {
86 if (s1.size() < s2.size()) {
87 return false;

Callers 1

TEST_FFunction · 0.85

Calls 2

sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected