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
+10 -5
View File
@@ -8,13 +8,15 @@ namespace chatterino {
const rapidjson::Value &getArgs(const rapidjson::Value &data)
{
if (!data.HasMember("args")) {
if (!data.HasMember("args"))
{
throw std::runtime_error("Missing member args");
}
const auto &args = data["args"];
if (!args.IsArray()) {
if (!args.IsArray())
{
throw std::runtime_error("args must be an array");
}
@@ -43,12 +45,14 @@ rapidjson::Document createListenMessage(
rapidjson::Value data(rapidjson::kObjectType);
if (account) {
if (account)
{
rj::set(data, "auth_token", account->getOAuthToken(), a);
}
rapidjson::Value topics(rapidjson::kArrayType);
for (const auto &topic : topicsVec) {
for (const auto &topic : topicsVec)
{
rj::add(topics, topic, a);
}
@@ -70,7 +74,8 @@ rapidjson::Document createUnlistenMessage(
rapidjson::Value data(rapidjson::kObjectType);
rapidjson::Value topics(rapidjson::kArrayType);
for (const auto &topic : topicsVec) {
for (const auto &topic : topicsVec)
{
rj::add(topics, topic, a);
}