MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / FindLongestCommonPrefix

Function FindLongestCommonPrefix

tensorflow/lite/toco/tooling_util.cc:39–54  ·  view source on GitHub ↗

Find the longest common prefix of two strings.

Source from the content-addressed store, hash-verified

37
38// Find the longest common prefix of two strings.
39absl::string_view FindLongestCommonPrefix(absl::string_view a,
40 absl::string_view b) {
41 if (a.empty() || b.empty()) return absl::string_view();
42
43 const char* pa = a.data();
44 const char* pb = b.data();
45 size_t count = 0;
46 const size_t limit = std::min(a.size(), b.size());
47 while (count < limit && *pa == *pb) {
48 ++pa;
49 ++pb;
50 ++count;
51 }
52
53 return absl::string_view(a.data(), count);
54}
55
56string LogName(const Operator& op) {
57 const string& opname = HelpfulOperatorTypeName(op);

Callers 3

RunMethod · 0.50
RunMethod · 0.50
RunMethod · 0.50

Calls 5

string_viewClass · 0.85
minFunction · 0.50
emptyMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected