1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-11-02 00:05:26 +01:00

Cache getTextureDirs()

This commit is contained in:
sfan5
2025-08-08 11:40:12 +02:00
parent 0b9ae73369
commit 55cca34ee9
7 changed files with 37 additions and 59 deletions

View File

@@ -105,7 +105,11 @@ public:
return result;
}
void clear() { m_values.clear(); }
void clear()
{
MutexAutoLock lock(m_mutex);
m_values.clear();
}
private:
std::map<Key, Value> m_values;

View File

@@ -15,12 +15,13 @@ template<typename T>
class MutexedVariable
{
public:
// default initialization
MutexedVariable() {}
MutexedVariable(const T &value):
m_value(value)
{}
m_value(value) {}
MutexedVariable(T &&value):
m_value(std::move(value))
{}
m_value(std::move(value)) {}
T get()
{