MCPcopy Create free account
hub / github.com/Snapchat/Valdi / operator==

Method operator==

valdi_core/src/valdi_core/cpp/Utils/StaticString.cpp:60–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60bool StaticString::operator==(const StaticString& other) const {
61 if (this == &other) {
62 return true;
63 }
64
65 switch (encoding()) {
66 case StaticString::Encoding::UTF8: {
67 if (other.encoding() != StaticString::Encoding::UTF8) {
68 return false;
69 }
70
71 return utf8StringView() == other.utf8StringView();
72 }
73 case StaticString::Encoding::UTF16: {
74 if (other.encoding() != StaticString::Encoding::UTF16) {
75 return false;
76 }
77 return utf16StringView() == other.utf16StringView();
78 }
79 case StaticString::Encoding::UTF32: {
80 if (other.encoding() != StaticString::Encoding::UTF32) {
81 return false;
82 }
83 return utf32StringView() == other.utf32StringView();
84 }
85 }
86}
87
88bool StaticString::operator!=(const StaticString& other) const {
89 return !(*this == other);

Callers

nothing calls this directly

Calls 4

utf8StringViewMethod · 0.80
utf16StringViewMethod · 0.80
utf32StringViewMethod · 0.80
encodingMethod · 0.45

Tested by

no test coverage detected