| 46 | } |
| 47 | |
| 48 | int InternalKeyComparator::Compare(const Slice& akey, const Slice& bkey) const { |
| 49 | // Order by: |
| 50 | // increasing user key (according to user-supplied comparator) |
| 51 | // decreasing sequence number |
| 52 | // decreasing type (though sequence# should be enough to disambiguate) |
| 53 | int r = user_comparator_->Compare(ExtractUserKey(akey), ExtractUserKey(bkey)); |
| 54 | if (r == 0) { |
| 55 | const uint64_t anum = DecodeFixed64(akey.data() + akey.size() - 8); |
| 56 | const uint64_t bnum = DecodeFixed64(bkey.data() + bkey.size() - 8); |
| 57 | if (anum > bnum) { |
| 58 | r = -1; |
| 59 | } else if (anum < bnum) { |
| 60 | r = +1; |
| 61 | } |
| 62 | } |
| 63 | return r; |
| 64 | } |
| 65 | |
| 66 | void InternalKeyComparator::FindShortestSeparator(std::string* start, |
| 67 | const Slice& limit) const { |
no test coverage detected