Initialize variable to avoid warning

Summary:
RocksDB debug version failed to build under gcc-4.8.1 on sandcastle with the following error:

```
db/db_compaction_filter_test.cc:570:33: error: ‘snapshot’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
```

Test Plan: make db_compaction_filter_test && ./db_compaction_filter_test

Reviewers: rven, anthony, yhchiang, aekmekji, igor, sdong

Reviewed By: igor, sdong

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D46725
main
Andres Noetzli 9 years ago
parent aeb4612685
commit 34cedaff66
  1. 3
      db/db_compaction_filter_test.cc

@ -548,7 +548,7 @@ TEST_F(DBTestCompactionFilter, CompactionFilterSnapshot) {
DestroyAndReopen(options);
// Put some data.
const Snapshot* snapshot;
const Snapshot* snapshot = nullptr;
for (int table = 0; table < 4; ++table) {
for (int i = 0; i < 10; ++i) {
Put(ToString(table * 100 + i), "val");
@ -559,6 +559,7 @@ TEST_F(DBTestCompactionFilter, CompactionFilterSnapshot) {
snapshot = db_->GetSnapshot();
}
}
assert(snapshot != nullptr);
cfilter_count = 0;
ASSERT_OK(db_->CompactRange(CompactRangeOptions(), nullptr, nullptr));

Loading…
Cancel
Save