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

Function FindLongestCommonPrefix

tensorflow/lite/toco/export_tensorflow.cc:1434–1449  ·  view source on GitHub ↗

TODO(aselle): Remove when available in absl

Source from the content-addressed store, hash-verified

1432namespace {
1433// TODO(aselle): Remove when available in absl
1434absl::string_view FindLongestCommonPrefix(absl::string_view a,
1435 absl::string_view b) {
1436 if (a.empty() || b.empty()) return absl::string_view();
1437
1438 const char* pa = a.data();
1439 const char* pb = b.data();
1440 string::difference_type count = 0;
1441 const string::difference_type limit = std::min(a.size(), b.size());
1442 while (count < limit && *pa == *pb) {
1443 ++pa;
1444 ++pb;
1445 ++count;
1446 }
1447
1448 return absl::string_view(a.data(), count);
1449}
1450} // namespace
1451
1452void ConvertLstmCellOperator(const Model& model, const LstmCellOperator& src_op,

Callers 1

ConvertLstmCellOperatorFunction · 0.70

Calls 5

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

Tested by

no test coverage detected