diff options
author | Andres Noetzli <andres.noetzli@gmail.com> | 2015-09-08 15:30:49 -0700 |
---|---|---|
committer | Andres Noetzli <andres.noetzli@gmail.com> | 2015-09-08 15:30:49 -0700 |
commit | 6bdc484fd834cc076e2bda74753d9663a06c7411 (patch) | |
tree | 2d7fb463506a2d56ebd6e05175c60103edaca69d /db/merge_helper.cc | |
parent | 7a31960ee94bfa41b73889104fa2e36adb704857 (diff) |
Added Equal method to Comparator interface
Summary:
In some cases, equality comparisons can be done more efficiently than three-way
comparisons. There are quite a few places in the code where we only care about
equality. This patch adds an Equal() method that defaults to using the
Compare() method.
Test Plan: make clean all check
Reviewers: rven, anthony, yhchiang, igor, sdong
Reviewed By: igor
Subscribers: dhruba, leveldb
Differential Revision: https://reviews.facebook.net/D46233
Diffstat (limited to 'db/merge_helper.cc')
-rw-r--r-- | db/merge_helper.cc | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/db/merge_helper.cc b/db/merge_helper.cc index 427013806..7d5f4c1e9 100644 --- a/db/merge_helper.cc +++ b/db/merge_helper.cc @@ -91,8 +91,7 @@ Status MergeHelper::MergeUntil(Iterator* iter, const SequenceNumber stop_before, assert(!"corrupted internal key is not expected"); } break; - } else if (user_comparator_->Compare(ikey.user_key, orig_ikey.user_key) != - 0) { + } else if (!user_comparator_->Equal(ikey.user_key, orig_ikey.user_key)) { // hit a different user key, stop right here hit_the_next_user_key = true; break; |