提交 55853de6 编写于 作者: J Jay Zhuang 提交者: Facebook GitHub Bot

Fix clang-analyze: use uninitiated variable (#8325)

Summary:
Error:
```
db/db_compaction_test.cc:5211:47: warning: The left operand of '*' is a garbage value
uint64_t total = (l1_avg_size + l2_avg_size * 10) * 10;
```

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

Test Plan: `$ make analyze`

Reviewed By: pdillinger

Differential Revision: D28620916

Pulled By: jay-zhuang

fbshipit-source-id: f6d58ab84eefbcc905cda45afb9522b0c6d230f8
上级 7303d02b
......@@ -5154,7 +5154,7 @@ TEST_F(DBCompactionTest, ManualCompactionBottomLevelOptimized) {
}
TEST_F(DBCompactionTest, ManualCompactionMax) {
uint64_t l1_avg_size, l2_avg_size;
uint64_t l1_avg_size = 0, l2_avg_size = 0;
auto generate_sst_func = [&]() {
Random rnd(301);
for (auto i = 0; i < 100; i++) {
......@@ -5208,7 +5208,7 @@ TEST_F(DBCompactionTest, ManualCompactionMax) {
ASSERT_TRUE(num_compactions.load() == 1);
// split the compaction to 5
uint64_t total = (l1_avg_size + l2_avg_size * 10) * 10;
uint64_t total = (l1_avg_size * 10) + (l2_avg_size * 100);
int num_split = 5;
opts.max_compaction_bytes = total / num_split;
DestroyAndReopen(opts);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册