mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
DB::loadBlock copy removal & DB backend cleanup
* Remove the copy from db::loadBlock by using a pointer to the destination * cleanup db backend, the child backend doesn't have to set their functions as virtual
This commit is contained in:
parent
decbd396df
commit
143401451c
11 changed files with 47 additions and 47 deletions
|
@ -30,13 +30,16 @@ bool Database_Dummy::saveBlock(const v3s16 &pos, const std::string &data)
|
|||
return true;
|
||||
}
|
||||
|
||||
std::string Database_Dummy::loadBlock(const v3s16 &pos)
|
||||
void Database_Dummy::loadBlock(const v3s16 &pos, std::string *block)
|
||||
{
|
||||
s64 i = getBlockAsInteger(pos);
|
||||
std::map<s64, std::string>::iterator it = m_database.find(i);
|
||||
if (it == m_database.end())
|
||||
return "";
|
||||
return it->second;
|
||||
if (it == m_database.end()) {
|
||||
*block = "";
|
||||
return;
|
||||
}
|
||||
|
||||
*block = it->second;
|
||||
}
|
||||
|
||||
bool Database_Dummy::deleteBlock(const v3s16 &pos)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue