std::vector<ConvergenceChannel*>::iterator ConvergenceService::GetChannel(const picojson::value &channel_json) {
ScopeLogger();
-
- std::vector<ConvergenceChannel*>::iterator it;
const auto id = channel_json.get(kId).get<std::string>();
const auto uri = channel_json.get(kUri).get<std::string>();
- for (it = opened_channels.begin(); it != opened_channels.end(); ++it) {
+ for (auto it = opened_channels.begin(); it != opened_channels.end(); ++it) {
if((*it)->GetUri() == uri && (*it)->GetId() == id) {
LoggerD("Found channel uri: [%s] id: [%s]", uri.c_str(), id.c_str());
- break;
+ return it;
}
}
- return it;
+ return opened_channels.end();
}
bool ConvergenceService::IsChannelStarted(std::vector<ConvergenceChannel*>::iterator it) {