提交 4a171882 编写于 作者: D Danny Al-Gaaf

db/version_set.cc: remove unnecessary checks

Fix for:

[db/version_set.cc:1219]: (style) Unsigned variable 'last_file'
 can't be negative so it is unnecessary to test it.
[db/version_set.cc:1234]: (style) Unsigned variable 'first_file'
 can't be negative so it is unnecessary to test it.
Signed-off-by: NDanny Al-Gaaf <danny.al-gaaf@bisect.de>
上级 bf3bfd04
......@@ -1216,7 +1216,7 @@ bool Version::HasOverlappingUserKey(
// Check the last file in inputs against the file after it
size_t last_file = FindFile(cfd_->internal_comparator(), file_level,
inputs->back()->largest.Encode());
assert(0 <= last_file && last_file < kNumFiles); // File should exist!
assert(last_file < kNumFiles); // File should exist!
if (last_file < kNumFiles-1) { // If not the last file
const Slice last_key_in_input = ExtractUserKey(
files[last_file].largest_key);
......@@ -1231,7 +1231,7 @@ bool Version::HasOverlappingUserKey(
// Check the first file in inputs against the file just before it
size_t first_file = FindFile(cfd_->internal_comparator(), file_level,
inputs->front()->smallest.Encode());
assert(0 <= first_file && first_file <= last_file); // File should exist!
assert(first_file <= last_file); // File should exist!
if (first_file > 0) { // If not first file
const Slice& first_key_in_input = ExtractUserKey(
files[first_file].smallest_key);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册