mirror of
https://github.com/minetest/minetest.git
synced 2025-02-17 10:23:47 +01:00
Make the dummy backend only look up blocks once
This commit is contained in:
@ -33,10 +33,10 @@ bool Database_Dummy::saveBlock(const v3s16 &pos, const std::string &data)
|
|||||||
std::string Database_Dummy::loadBlock(const v3s16 &pos)
|
std::string Database_Dummy::loadBlock(const v3s16 &pos)
|
||||||
{
|
{
|
||||||
s64 i = getBlockAsInteger(pos);
|
s64 i = getBlockAsInteger(pos);
|
||||||
if (m_database.count(i))
|
std::map<s64, std::string>::iterator it = m_database.find(i);
|
||||||
return m_database[i];
|
if (it == m_database.end())
|
||||||
else
|
|
||||||
return "";
|
return "";
|
||||||
|
return it->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Database_Dummy::deleteBlock(const v3s16 &pos)
|
bool Database_Dummy::deleteBlock(const v3s16 &pos)
|
||||||
|
Reference in New Issue
Block a user