Lexicographically compare two strings (possibly containing nulls), and return true if the first is less than the second.
| 695 | // Lexicographically compare two strings (possibly containing nulls), and |
| 696 | // return true if the first is less than the second. |
| 697 | static inline bool StringLessThan(const char *a_data, uoffset_t a_size, |
| 698 | const char *b_data, uoffset_t b_size) { |
| 699 | const auto cmp = memcmp(a_data, b_data, (std::min)(a_size, b_size)); |
| 700 | return cmp == 0 ? a_size < b_size : cmp < 0; |
| 701 | } |
| 702 | |
| 703 | struct String : public Vector<char> { |
| 704 | const char *c_str() const { return reinterpret_cast<const char *>(Data()); } |
no outgoing calls
no test coverage detected