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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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;