Skip to content

Commit

Permalink
Make the dummy backend only look up blocks once
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadowNinja committed Mar 8, 2015
1 parent c788b17 commit 969413b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/database-dummy.cpp
Expand Up @@ -33,10 +33,10 @@ bool Database_Dummy::saveBlock(const v3s16 &pos, const std::string &data)
std::string Database_Dummy::loadBlock(const v3s16 &pos)
{
s64 i = getBlockAsInteger(pos);
if (m_database.count(i))
return m_database[i];
else
std::map<s64, std::string>::iterator it = m_database.find(i);
if (it == m_database.end())
return "";
return it->second;
}

bool Database_Dummy::deleteBlock(const v3s16 &pos)
Expand Down

0 comments on commit 969413b

Please sign in to comment.