| 58 | } |
| 59 | |
| 60 | bool 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 | |
| 88 | bool StaticString::operator!=(const StaticString& other) const { |
| 89 | return !(*this == other); |
nothing calls this directly
no test coverage detected