From f4e304f987590ef89dcd31f4f7c36b71d496a1ef Mon Sep 17 00:00:00 2001 From: darionyaphet Date: Mon, 3 Jul 2023 09:41:48 -0700 Subject: [PATCH] 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 --- db/file_indexer.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/db/file_indexer.cc b/db/file_indexer.cc index 608f1cb28d..ee6cfdc03f 100644 --- a/db/file_indexer.cc +++ b/db/file_indexer.cc @@ -56,17 +56,15 @@ void FileIndexer::GetNextLevelIndex(const size_t level, const size_t file_index, } else if (cmp_smallest == 0) { *left_bound = index.smallest_lb; *right_bound = index.smallest_rb; - } else if (cmp_smallest > 0 && cmp_largest < 0) { + } else if (cmp_largest < 0) { *left_bound = index.smallest_lb; *right_bound = index.largest_rb; } else if (cmp_largest == 0) { *left_bound = index.largest_lb; *right_bound = index.largest_rb; - } else if (cmp_largest > 0) { + } else { *left_bound = index.largest_lb; *right_bound = level_rb_[level + 1]; - } else { - assert(false); } assert(*left_bound >= 0);