| 4210 | |
| 4211 | template <typename StringT> |
| 4212 | int compare(const StringT& rhs) const { |
| 4213 | auto j = begin(); |
| 4214 | auto k = rhs.begin(); |
| 4215 | auto jEnd = end(); |
| 4216 | auto kEnd = rhs.end(); |
| 4217 | |
| 4218 | while (j != jEnd && k != kEnd) { |
| 4219 | int cmp = *j - *k; |
| 4220 | if (cmp != 0) { |
| 4221 | return cmp; |
| 4222 | } |
| 4223 | } |
| 4224 | |
| 4225 | // If we've reached the end of *this, then values are equal if rhs is also exhausted, otherwise *this is less |
| 4226 | // than rhs |
| 4227 | if (j == jEnd) { |
| 4228 | return k == kEnd ? 0 : -1; |
| 4229 | } |
| 4230 | |
| 4231 | return 1; |
| 4232 | } |
| 4233 | }; |
| 4234 | |
| 4235 | // A BTree node link is a list of LogicalPageID's whose contents should be concatenated together. |