| 733 | } |
| 734 | |
| 735 | bool StringFunctions::TrimContext::Contains(const uint8_t* utf8_char, int len) const { |
| 736 | auto eq = [&](const uint8_t* c){ return memcmp(c, utf8_char, len) == 0; }; |
| 737 | switch (len) { |
| 738 | case 1: return single_byte_chars_.test(*utf8_char); |
| 739 | case 2: return any_of(double_byte_chars_.begin(), double_byte_chars_.end(), eq); |
| 740 | case 3: return any_of(triple_byte_chars_.begin(), triple_byte_chars_.end(), eq); |
| 741 | case 4: return any_of(quadruple_byte_chars_.begin(), quadruple_byte_chars_.end(), eq); |
| 742 | default: DCHECK(false); return false; |
| 743 | } |
| 744 | } |
| 745 | |
| 746 | void StringFunctions::TrimPrepare(FunctionContext* context, |
| 747 | FunctionContext::FunctionStateScope scope) { |
no test coverage detected