1
0
mirror of https://github.com/luanti-org/minetestmapper.git synced 2025-10-06 22:05:22 +02:00

C++11 code modernization

This commit is contained in:
sfan5
2020-03-26 23:07:27 +01:00
parent 1d678ffa82
commit 9096f70188
8 changed files with 46 additions and 66 deletions

View File

@@ -60,13 +60,13 @@ void DBLevelDB::getBlocksOnZ(std::map<int16_t, BlockList> &blocks, int16_t zPos)
std::string datastr;
leveldb::Status status;
for (std::vector<BlockPos>::iterator it = posCache.begin(); it != posCache.end(); ++it) {
if (it->z != zPos) {
for (const auto &it : posCache) {
if (it.z != zPos) {
continue;
}
status = db->Get(leveldb::ReadOptions(), i64tos(encodeBlockPos(*it)), &datastr);
status = db->Get(leveldb::ReadOptions(), i64tos(encodeBlockPos(it)), &datastr);
if (status.ok()) {
Block b(*it, ustring((const unsigned char *) datastr.data(), datastr.size()));
Block b(it, ustring((const unsigned char *) datastr.data(), datastr.size()));
blocks[b.first.x].push_back(b);
}
}