From 0cd1521af5b79257820a1c7c1d131ba3393c9e12 Mon Sep 17 00:00:00 2001 From: kailiu Date: Thu, 12 Dec 2013 16:36:38 -0800 Subject: [PATCH] Completely remove argv_ since no one use it There are still warning in some other environment, just move that useless variable `argv_` --- db/db_test.cc | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/db/db_test.cc b/db/db_test.cc index 918126bbe..27e90f110 100644 --- a/db/db_test.cc +++ b/db/db_test.cc @@ -2590,12 +2590,11 @@ class DeleteFilter : public CompactionFilter { class ChangeFilter : public CompactionFilter { public: - explicit ChangeFilter(int argv) : argv_(argv) {} + explicit ChangeFilter() {} virtual bool Filter(int level, const Slice& key, const Slice& value, std::string* new_value, bool* value_changed) const override { - assert(argv_ == 100); assert(new_value != nullptr); *new_value = NEW_VALUE; *value_changed = true; @@ -2605,9 +2604,6 @@ class ChangeFilter : public CompactionFilter { virtual const char* Name() const override { return "ChangeFilter"; } - - private: - const int __attribute__((unused)) argv_; }; class KeepFilterFactory : public CompactionFilterFactory { @@ -2636,19 +2632,16 @@ class DeleteFilterFactory : public CompactionFilterFactory { class ChangeFilterFactory : public CompactionFilterFactory { public: - explicit ChangeFilterFactory(int argv) : argv_(argv) {} + explicit ChangeFilterFactory() {} virtual std::unique_ptr CreateCompactionFilter(const CompactionFilter::Context& context) override { - return std::unique_ptr(new ChangeFilter(argv_)); + return std::unique_ptr(new ChangeFilter()); } virtual const char* Name() const override { return "ChangeFilterFactory"; } - - private: - const int argv_; }; TEST(DBTest, CompactionFilter) { @@ -2795,7 +2788,7 @@ TEST(DBTest, CompactionFilterWithValueChange) { options.num_levels = 3; options.max_mem_compaction_level = 0; options.compaction_filter_factory = - std::make_shared(100); + std::make_shared(); Reopen(&options); // Write 100K+1 keys, these are written to a few files