Fix compiler warning treated as error (#6547)

Summary:
Define a private member variable only in debug mode. Without fix, build will fail
```
In file included from table/block_based/partitioned_index_iterator.cc:9:
./table/block_based/partitioned_index_iterator.h:125:32: error: private field 'icomp_' is not used [-Werror,-Wunused-private-field]
  const InternalKeyComparator& icomp_;
```

Test plan (dev server)
1. make check
2. Make sure fixed in Travis
Pull Request resolved: https://github.com/facebook/rocksdb/pull/6547

Reviewed By: siying

Differential Revision: D20480027

Pulled By: pdillinger

fbshipit-source-id: 288bc94280e240c3136335b6c73eb1ccb0db459d
main
Yanqin Jin 5 years ago committed by Facebook GitHub Bot
parent 6c595f008a
commit 098dce2d1a
  1. 4
      table/block_based/partitioned_index_iterator.h

@ -29,7 +29,9 @@ class ParititionedIndexIterator : public InternalIteratorBase<IndexValue> {
TableReaderCaller caller, size_t compaction_readahead_size = 0)
: table_(table),
read_options_(read_options),
#ifndef NDEBUG
icomp_(icomp),
#endif
user_comparator_(icomp.user_comparator()),
index_iter_(std::move(index_iter)),
block_iter_points_to_real_block_(false),
@ -122,7 +124,9 @@ class ParititionedIndexIterator : public InternalIteratorBase<IndexValue> {
private:
const BlockBasedTable* table_;
const ReadOptions read_options_;
#ifndef NDEBUG
const InternalKeyComparator& icomp_;
#endif
UserComparatorWrapper user_comparator_;
std::unique_ptr<InternalIteratorBase<IndexValue>> index_iter_;
IndexBlockIter block_iter_;

Loading…
Cancel
Save