| 41 | } |
| 42 | |
| 43 | std::string_view string_t::getAsStringView() const { |
| 44 | if (len <= SHORT_STR_LENGTH) { |
| 45 | return std::string_view((char*)prefix, len); |
| 46 | } else { |
| 47 | return std::string_view(reinterpret_cast<char*>(overflowPtr), len); |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | bool string_t::operator==(const string_t& rhs) const { |
| 52 | // First compare the length and prefix of the strings. |