From c15df15f0784494f897dbf442624f8c5545fdafd Mon Sep 17 00:00:00 2001 From: Abhishek Madan Date: Tue, 18 Dec 2018 14:10:31 -0800 Subject: [PATCH] Fix unused member compile error Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/4793 Differential Revision: D13509363 Pulled By: abhimadan fbshipit-source-id: 530b4765e3335d6ecd016bfaa89645f8aa98c61f --- db/range_del_aggregator.cc | 10 ++-------- db/range_del_aggregator.h | 14 ++++---------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/db/range_del_aggregator.cc b/db/range_del_aggregator.cc index 8a6b0a51f..3685d717d 100644 --- a/db/range_del_aggregator.cc +++ b/db/range_del_aggregator.cc @@ -154,17 +154,14 @@ TruncatedRangeDelIterator::SplitBySnapshot( } ForwardRangeDelIterator::ForwardRangeDelIterator( - const InternalKeyComparator* icmp, - const std::vector>* iters) + const InternalKeyComparator* icmp) : icmp_(icmp), - iters_(iters), unused_idx_(0), active_seqnums_(SeqMaxComparator()), active_iters_(EndKeyMinComparator(icmp)), inactive_iters_(StartKeyMinComparator(icmp)) {} bool ForwardRangeDelIterator::ShouldDelete(const ParsedInternalKey& parsed) { - assert(iters_ != nullptr); // Move active iterators that end before parsed. while (!active_iters_.empty() && icmp_->Compare((*active_iters_.top())->end_key(), parsed) <= 0) { @@ -200,17 +197,14 @@ void ForwardRangeDelIterator::Invalidate() { } ReverseRangeDelIterator::ReverseRangeDelIterator( - const InternalKeyComparator* icmp, - const std::vector>* iters) + const InternalKeyComparator* icmp) : icmp_(icmp), - iters_(iters), unused_idx_(0), active_seqnums_(SeqMaxComparator()), active_iters_(StartKeyMaxComparator(icmp)), inactive_iters_(EndKeyMaxComparator(icmp)) {} bool ReverseRangeDelIterator::ShouldDelete(const ParsedInternalKey& parsed) { - assert(iters_ != nullptr); // Move active iterators that start after parsed. while (!active_iters_.empty() && icmp_->Compare(parsed, (*active_iters_.top())->start_key()) < 0) { diff --git a/db/range_del_aggregator.h b/db/range_del_aggregator.h index a59cbaf1b..712ae4583 100644 --- a/db/range_del_aggregator.h +++ b/db/range_del_aggregator.h @@ -110,9 +110,7 @@ struct StartKeyMinComparator { class ForwardRangeDelIterator { public: - ForwardRangeDelIterator( - const InternalKeyComparator* icmp, - const std::vector>* iters); + explicit ForwardRangeDelIterator(const InternalKeyComparator* icmp); bool ShouldDelete(const ParsedInternalKey& parsed); void Invalidate(); @@ -181,7 +179,6 @@ class ForwardRangeDelIterator { } const InternalKeyComparator* icmp_; - const std::vector>* iters_; size_t unused_idx_; ActiveSeqSet active_seqnums_; BinaryHeap active_iters_; @@ -190,9 +187,7 @@ class ForwardRangeDelIterator { class ReverseRangeDelIterator { public: - ReverseRangeDelIterator( - const InternalKeyComparator* icmp, - const std::vector>* iters); + explicit ReverseRangeDelIterator(const InternalKeyComparator* icmp); bool ShouldDelete(const ParsedInternalKey& parsed); void Invalidate(); @@ -268,7 +263,6 @@ class ReverseRangeDelIterator { } const InternalKeyComparator* icmp_; - const std::vector>* iters_; size_t unused_idx_; ActiveSeqSet active_seqnums_; BinaryHeap active_iters_; @@ -311,8 +305,8 @@ class RangeDelAggregator { StripeRep(const InternalKeyComparator* icmp, SequenceNumber upper_bound, SequenceNumber lower_bound) : icmp_(icmp), - forward_iter_(icmp, &iters_), - reverse_iter_(icmp, &iters_), + forward_iter_(icmp), + reverse_iter_(icmp), upper_bound_(upper_bound), lower_bound_(lower_bound) {}