Simplify conditional judgment (#11580)

Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/11580

Reviewed By: ajkr

Differential Revision: D47158687

Pulled By: cbi42

fbshipit-source-id: 4841b77eee78ddcf35da6ea33da71861c5f1e773
This commit is contained in:
darionyaphet 2023-07-03 09:41:48 -07:00 committed by Facebook GitHub Bot
parent 15053f3ab4
commit f4e304f987
1 changed files with 2 additions and 4 deletions

View File

@ -56,17 +56,15 @@ void FileIndexer::GetNextLevelIndex(const size_t level, const size_t file_index,
} else if (cmp_smallest == 0) { } else if (cmp_smallest == 0) {
*left_bound = index.smallest_lb; *left_bound = index.smallest_lb;
*right_bound = index.smallest_rb; *right_bound = index.smallest_rb;
} else if (cmp_smallest > 0 && cmp_largest < 0) { } else if (cmp_largest < 0) {
*left_bound = index.smallest_lb; *left_bound = index.smallest_lb;
*right_bound = index.largest_rb; *right_bound = index.largest_rb;
} else if (cmp_largest == 0) { } else if (cmp_largest == 0) {
*left_bound = index.largest_lb; *left_bound = index.largest_lb;
*right_bound = index.largest_rb; *right_bound = index.largest_rb;
} else if (cmp_largest > 0) { } else {
*left_bound = index.largest_lb; *left_bound = index.largest_lb;
*right_bound = level_rb_[level + 1]; *right_bound = level_rb_[level + 1];
} else {
assert(false);
} }
assert(*left_bound >= 0); assert(*left_bound >= 0);