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:
@@ -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;
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user