added brace wrapping after if and for

This commit is contained in:
fourtf
2018-10-21 13:43:02 +02:00
parent c6e1ec3c71
commit e259b9e39f
138 changed files with 4738 additions and 2237 deletions
+7 -3
View File
@@ -19,7 +19,8 @@ EmotePtr cachedOrMakeEmotePtr(Emote &&emote, const EmoteMap &cache)
{
// reuse old shared_ptr if nothing changed
auto it = cache.find(emote.name);
if (it != cache.end() && *it->second == emote) return it->second;
if (it != cache.end() && *it->second == emote)
return it->second;
return std::make_shared<Emote>(std::move(emote));
}
@@ -32,10 +33,13 @@ EmotePtr cachedOrMakeEmotePtr(
std::lock_guard<std::mutex> guard(mutex);
auto shared = cache[id].lock();
if (shared && *shared == emote) {
if (shared && *shared == emote)
{
// reuse old shared_ptr if nothing changed
return shared;
} else {
}
else
{
shared = std::make_shared<Emote>(std::move(emote));
cache[id] = shared;
return shared;