Fix clang error in PartitionedFilterBlockBuilder

Summary: Closes https://github.com/facebook/rocksdb/pull/2536

Differential Revision: D5371271

Pulled By: maysamyabandeh

fbshipit-source-id: f1355ac658a79c9982a24986f0925c9e24fc39d5
This commit is contained in:
Maysam Yabandeh 2017-07-05 11:07:29 -07:00 committed by Facebook Github Bot
parent 45b9bb0331
commit f6b9d9355e
2 changed files with 7 additions and 9 deletions

View File

@ -81,9 +81,9 @@ FilterBlockBuilder* CreateFilterBlockBuilder(
// as partition size.
assert(table_opt.block_size_deviation <= 100);
auto partition_size =
(const uint32_t)(table_opt.metadata_block_size *
static_cast<const uint32_t>(table_opt.metadata_block_size *
(100 - table_opt.block_size_deviation));
partition_size = std::max(partition_size, (const uint32_t)1);
partition_size = std::max(partition_size, static_cast<const uint32_t>(1));
return new PartitionedFilterBlockBuilder(
opt.prefix_extractor, table_opt.whole_key_filtering,
filter_bits_builder, table_opt.index_block_restart_interval,

View File

@ -89,12 +89,10 @@ class PartitionedFilterBlockTest : public testing::Test {
PartitionedFilterBlockBuilder* NewBuilder(
PartitionedIndexBuilder* const p_index_builder) {
uint32_t partition_size =
table_options_.metadata_block_size >
(uint64_t)table_options_.block_size_deviation
? table_options_.metadata_block_size -
table_options_.block_size_deviation
: 1;
assert(table_opt.block_size_deviation <= 100);
auto partition_size = static_cast<const uint32_t>(
table_opt.metadata_block_size * (100 - table_opt.block_size_deviation));
partition_size = std::max(partition_size, static_cast<const uint32_t>(1));
return new PartitionedFilterBlockBuilder(
nullptr, table_options_.whole_key_filtering,
table_options_.filter_policy->GetFilterBitsBuilder(),