[RocksDB] Minor iterator cleanup

Summary: Was going through the iterator related code, did some cleanup along the way. Basically replaced array with vector and adopted range based loop where applicable.

Test Plan: make check; make valgrind_check

Reviewers: dhruba, emayanke

Reviewed By: emayanke

CC: leveldb

Differential Revision: https://reviews.facebook.net/D12435
This commit is contained in:
Haobo Xu
2013-08-20 22:58:16 -07:00
parent 404d63ac3e
commit f9e2decf7c
2 changed files with 40 additions and 44 deletions

View File

@@ -210,10 +210,10 @@ void Version::AddIterators(const ReadOptions& options,
const EnvOptions& soptions,
std::vector<Iterator*>* iters) {
// Merge all level zero files together since they may overlap
for (size_t i = 0; i < files_[0].size(); i++) {
for (const FileMetaData* file : files_[0]) {
iters->push_back(
vset_->table_cache_->NewIterator(
options, soptions, files_[0][i]->number, files_[0][i]->file_size));
options, soptions, file->number, file->file_size));
}
// For levels > 0, we can use a concatenating iterator that sequentially