mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 02:50:29 +00:00
refactor(Core/Misc): add braces and impove codestyle (#6402)
This commit is contained in:
@@ -30,11 +30,15 @@ public:
|
||||
{
|
||||
static_assert(std::is_base_of<Base, T>::value, "T must derive from Base");
|
||||
if (Container.empty())
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto it = Container.find(k);
|
||||
if (it != Container.end())
|
||||
{
|
||||
return dynamic_cast<T*>(it->second.get());
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -47,7 +51,9 @@ public:
|
||||
{
|
||||
static_assert(std::is_base_of<Base, T>::value, "T must derive from Base");
|
||||
if (T* v = Get<T>(k))
|
||||
{
|
||||
return v;
|
||||
}
|
||||
T* v = new T();
|
||||
Container.emplace(k, std::unique_ptr<T>(v));
|
||||
return v;
|
||||
|
||||
Reference in New Issue
Block a user