]> git.lizzy.rs Git - minetest.git/blobdiff - src/settings.cpp
Use unordered_map instead of map for MapSectors
[minetest.git] / src / settings.cpp
index cf7ec1b721d0f351647e7778295db52400d677a9..0e44ee0bcb6c9adbc7915d228843a8c5fd85298d 100644 (file)
@@ -659,9 +659,7 @@ bool Settings::getNoiseParamsFromGroup(const std::string &name,
 
 bool Settings::exists(const std::string &name) const
 {
-       MutexAutoLock lock(m_mutex);
-
-       if (m_settings.find(name) != m_settings.end())
+       if (existsLocal(name))
                return true;
        if (auto parent = getParent())
                return parent->exists(name);
@@ -669,6 +667,14 @@ bool Settings::exists(const std::string &name) const
 }
 
 
+bool Settings::existsLocal(const std::string &name) const
+{
+       MutexAutoLock lock(m_mutex);
+
+       return m_settings.find(name) != m_settings.end();
+}
+
+
 std::vector<std::string> Settings::getNames() const
 {
        MutexAutoLock lock(m_mutex);