Lexicographically compare two strings (possibly containing nulls), and return true if the first is less than the second.
| 620 | // Lexicographically compare two strings (possibly containing nulls), and |
| 621 | // return true if the first is less than the second. |
| 622 | static inline bool StringLessThan(const char *a_data, uoffset_t a_size, |
| 623 | const char *b_data, uoffset_t b_size) { |
| 624 | const auto cmp = memcmp(a_data, b_data, (std::min)(a_size, b_size)); |
| 625 | return cmp == 0 ? a_size < b_size : cmp < 0; |
| 626 | } |
| 627 | |
| 628 | struct String : public Vector<char> { |
| 629 | const char *c_str() const { return reinterpret_cast<const char *>(Data()); } |
no outgoing calls
no test coverage detected