MCPcopy Create free account
hub / github.com/bytedance/sonic-cpp / string_view_cmp

Function string_view_cmp

tests/string_view_test.cpp:27–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25
26template <OpType T>
27bool string_view_cmp(const char* s1, const char* s2) {
28 StringView sv1(s1);
29 StringView sv2(s2);
30 switch (T) {
31 case OpType::EQ:
32 return sv1 == sv2;
33 case OpType::NE:
34 return sv1 != sv2;
35 case OpType::LT:
36 return sv1 < sv2;
37 case OpType::LE:
38 return sv1 <= sv2;
39 case OpType::GT:
40 return sv1 > sv2;
41 case OpType::GE:
42 return sv1 >= sv2;
43 default:
44 break;
45 }
46 return false;
47}
48
49TEST(StringView, Basic) {
50 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected