aboutsummaryrefslogtreecommitdiff
path: root/src/database-leveldb.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/database-leveldb.cpp')
-rw-r--r--src/database-leveldb.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/database-leveldb.cpp b/src/database-leveldb.cpp
index acd0fd1eb..f46f82b98 100644
--- a/src/database-leveldb.cpp
+++ b/src/database-leveldb.cpp
@@ -65,16 +65,13 @@ bool Database_LevelDB::saveBlock(const v3s16 &pos, const std::string &data)
return true;
}
-std::string Database_LevelDB::loadBlock(const v3s16 &pos)
+void Database_LevelDB::loadBlock(const v3s16 &pos, std::string *block)
{
std::string datastr;
leveldb::Status status = m_database->Get(leveldb::ReadOptions(),
i64tos(getBlockAsInteger(pos)), &datastr);
- if(status.ok())
- return datastr;
- else
- return "";
+ *block = (status.ok()) ? datastr : "";
}
bool Database_LevelDB::deleteBlock(const v3s16 &pos)