Fixes for g++ 4.9.2 compatibility (#6053)

Summary:
Taken from merryChris in https://github.com/facebook/rocksdb/issues/6043

Stackoverflow ref on {{}} vs. {}:
https://stackoverflow.com/questions/26947704/implicit-conversion-failure-from-initializer-list

Note to reader: .clear() does not empty out an ostringstream, but .str("")
suffices because we don't have to worry about clearing error flags.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/6053

Test Plan: make check, manual run of filter_bench

Differential Revision: D18602259

Pulled By: pdillinger

fbshipit-source-id: f6190f83b8eab4e80e7c107348839edabe727841
main
Peter Dillinger 5 years ago committed by Facebook Github Bot
parent ec3e3c3e02
commit 0306e01233
  1. 2
      db/compaction/compaction_iterator_test.cc
  2. 2
      util/filter_bench.cc

@ -184,7 +184,7 @@ class TestSnapshotChecker : public SnapshotChecker {
public: public:
explicit TestSnapshotChecker( explicit TestSnapshotChecker(
SequenceNumber last_committed_sequence, SequenceNumber last_committed_sequence,
const std::unordered_map<SequenceNumber, SequenceNumber>& snapshots = {}) const std::unordered_map<SequenceNumber, SequenceNumber>& snapshots = {{}})
: last_committed_sequence_(last_committed_sequence), : last_committed_sequence_(last_committed_sequence),
snapshots_(snapshots) {} snapshots_(snapshots) {}

@ -606,7 +606,7 @@ double FilterBench::RandomQueryTest(uint32_t inside_threshold, bool dry_run,
} }
if (!dry_run) { if (!dry_run) {
fp_rate_report_ = std::ostringstream(); fp_rate_report_.str("");
uint64_t q = 0; uint64_t q = 0;
uint64_t fp = 0; uint64_t fp = 0;
double worst_fp_rate = 0.0; double worst_fp_rate = 0.0;

Loading…
Cancel
Save