summaryrefslogtreecommitdiff
path: root/db/merge_helper.cc
diff options
context:
space:
mode:
authorAndres Noetzli <andres.noetzli@gmail.com>2015-09-08 15:30:49 -0700
committerAndres Noetzli <andres.noetzli@gmail.com>2015-09-08 15:30:49 -0700
commit6bdc484fd834cc076e2bda74753d9663a06c7411 (patch)
tree2d7fb463506a2d56ebd6e05175c60103edaca69d /db/merge_helper.cc
parent7a31960ee94bfa41b73889104fa2e36adb704857 (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.cc3
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;