diff --git a/src/nameserver/namespace.cc b/src/nameserver/namespace.cc index 915ba95c..d5ea3520 100644 --- a/src/nameserver/namespace.cc +++ b/src/nameserver/namespace.cc @@ -728,14 +728,13 @@ bool NameSpace::RebuildBlockMap(std::function callback) } LOG(INFO, "Check orphan done, %lu entries", orphan_entrys.size()); if (FLAGS_remove_orphan_entry) { - for (std::vector >::iterator it = - orphan_entrys.begin(); it != orphan_entrys.end(); ++it) { + for (auto& it : orphan_entrys) { int64_t entry_id; std::string name; - DecodingStoreKey((*it).first, &entry_id, &name); + DecodingStoreKey(it.first, &entry_id, &name); FileInfo file_info; - file_info.ParseFromArray((*it).second.data(), (*it).second.size()); - db_->Delete(leveldb::WriteOptions(), (*it).first); + file_info.ParseFromArray(it.second.data(), it.second.size()); + db_->Delete(leveldb::WriteOptions(), it.first); LOG(INFO, "Remove orphan entry E%ld", entry_id); } }