diff options
Diffstat (limited to 'src/database-leveldb.cpp')
-rw-r--r-- | src/database-leveldb.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/database-leveldb.cpp b/src/database-leveldb.cpp index acd0fd1eb..4a4904c6a 100644 --- a/src/database-leveldb.cpp +++ b/src/database-leveldb.cpp @@ -33,7 +33,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #define ENSURE_STATUS_OK(s) \ if (!(s).ok()) { \ - throw FileNotGoodException(std::string("LevelDB error: ") + \ + throw DatabaseException(std::string("LevelDB error: ") + \ (s).ToString()); \ } @@ -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) |