mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 07:48:02 +00:00
fix(Core/GUARD_RETURN): correct typo (#3743)
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|
||||||
#define RETURN_GUARD(mutex, retval) if (!mutex.try_lock()) \
|
#define GUARD_RETURN(mutex, retval) if (!mutex.try_lock()) \
|
||||||
return retval; \
|
return retval; \
|
||||||
std::lock_guard<decltype(mutex)> guard(mutex, std::adopt_lock)
|
std::lock_guard<decltype(mutex)> guard(mutex, std::adopt_lock)
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public:
|
|||||||
|
|
||||||
void Insert(K key, T* val)
|
void Insert(K key, T* val)
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> guard(_mutex);
|
std::lock_guard<std::mutex> guard(mutex);
|
||||||
|
|
||||||
if (_items.size() > FlushLimit)
|
if (_items.size() > FlushLimit)
|
||||||
Clear();
|
Clear();
|
||||||
@@ -33,7 +33,7 @@ public:
|
|||||||
|
|
||||||
T* Get(K key)
|
T* Get(K key)
|
||||||
{
|
{
|
||||||
RETURN_GUAD(mutex, false);
|
GUARD_RETURN(mutex, nullptr);
|
||||||
typename std::map<K, T*>::iterator itr = _items.find(key);
|
typename std::map<K, T*>::iterator itr = _items.find(key);
|
||||||
if (itr != _items.end())
|
if (itr != _items.end())
|
||||||
return itr->second;
|
return itr->second;
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ void MPQManager::InitializeDBC()
|
|||||||
|
|
||||||
FILE* MPQManager::GetFile(const std::string& path )
|
FILE* MPQManager::GetFile(const std::string& path )
|
||||||
{
|
{
|
||||||
RETURN_GUAD(mutex, false);
|
GUARD_RETURN(mutex, nullptr);
|
||||||
MPQFile file(path.c_str());
|
MPQFile file(path.c_str());
|
||||||
if (file.isEof())
|
if (file.isEof())
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@@ -87,7 +87,7 @@ DBC* MPQManager::GetDBC(const std::string& name )
|
|||||||
|
|
||||||
FILE* MPQManager::GetFileFrom(const std::string& path, MPQArchive* file )
|
FILE* MPQManager::GetFileFrom(const std::string& path, MPQArchive* file )
|
||||||
{
|
{
|
||||||
RETURN_GUAD(mutex, false);
|
GUARD_RETURN(mutex, nullptr);
|
||||||
mpq_archive* mpq_a = file->mpq_a;
|
mpq_archive* mpq_a = file->mpq_a;
|
||||||
|
|
||||||
uint32_t filenum;
|
uint32_t filenum;
|
||||||
|
|||||||
Reference in New Issue
Block a user