refactor(Core/Misc): add braces and impove codestyle (#6402)

This commit is contained in:
Kargatum
2021-06-25 00:50:18 +07:00
committed by GitHub
parent 33c271cc7c
commit 3c24b511f2
72 changed files with 1486 additions and 401 deletions

View File

@@ -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;