Skip to content

Commit b9ce156

Browse files
committed
Add assert to MergeOperator::PartialMergeMulti to check # of operands.
Summary: Add assert(operands_list.size() >= 2) in MergeOperator::PartialMergeMulti to ensure it's only be called when we have at least two merge operands. Test Plan: run merge_test and stringappend_test. Reviewers: haobo, igor Reviewed By: igor CC: leveldb Differential Revision: https://reviews.facebook.net/D17169
1 parent 5c44a8d commit b9ce156

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

db/merge_operator.cc

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ bool MergeOperator::PartialMergeMulti(const Slice& key,
1818
const std::deque<Slice>& operand_list,
1919
std::string* new_value,
2020
Logger* logger) const {
21+
assert(operand_list.size() >= 2);
2122
// Simply loop through the operands
2223
std::string temp_value;
2324
Slice temp_slice(operand_list[0]);

0 commit comments

Comments
 (0)