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
oxigraph-main
darionyaphet 1 year ago committed by Facebook GitHub Bot
parent 15053f3ab4
commit f4e304f987
  1. 6
      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) { } 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);

Loading…
Cancel
Save