This commit is contained in:
badaix 2021-02-10 18:36:40 +01:00
parent 1aa8831416
commit f5d4fcaf43
34 changed files with 274 additions and 273 deletions

View file

@ -1,6 +1,6 @@
/***
This file is part of snapcast
Copyright (C) 2014-2020 Johannes Pohl
Copyright (C) 2014-2021 Johannes Pohl
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -94,7 +94,7 @@ void Config::init(const std::string& root_directory, const std::string& user, co
{
json j;
ifs >> j;
if (j.count("ConfigVersion"))
if (j.count("ConfigVersion") != 0u)
{
json jGroups = j["Groups"];
for (auto& jGroup : jGroups)
@ -132,7 +132,7 @@ ClientInfoPtr Config::getClientInfo(const std::string& clientId) const
if (clientId.empty())
return nullptr;
for (auto group : groups)
for (const auto& group : groups)
{
for (auto client : group->clients)
{
@ -183,7 +183,7 @@ GroupPtr Config::getGroupFromClient(const std::string& clientId)
{
for (auto group : groups)
{
for (auto c : group->clients)
for (const auto& c : group->clients)
{
if (c->id == clientId)
return group;
@ -219,7 +219,7 @@ json Config::getServerStatus(const json& streams) const
json Config::getGroups() const
{
json result = json::array();
for (auto group : groups)
for (const auto& group : groups)
result.push_back(group->toJson());
return result;
}