diff --git a/src/DownloadEngine.cc b/src/DownloadEngine.cc index 3b70364b..9f3283dc 100644 --- a/src/DownloadEngine.cc +++ b/src/DownloadEngine.cc @@ -122,7 +122,7 @@ void executeCommand(std::deque>& commands, { size_t max = commands.size(); for(size_t i = 0; i < max; ++i) { - std::unique_ptr com = std::move(commands.front()); + auto com = std::move(commands.front()); commands.pop_front(); if(com->statusMatch(statusFilter)) { com->transitStatus(); diff --git a/src/WebSocketSessionMan.cc b/src/WebSocketSessionMan.cc index 1dab1201..3062a821 100644 --- a/src/WebSocketSessionMan.cc +++ b/src/WebSocketSessionMan.cc @@ -77,10 +77,9 @@ void WebSocketSessionMan::addNotification params->append(std::move(eventSpec)); dict->put("params", std::move(params)); std::string msg = json::encode(dict.get()); - for(WebSocketSessions::const_iterator i = sessions_.begin(), - eoi = sessions_.end(); i != eoi; ++i) { - (*i)->addTextMessage(msg); - (*i)->getCommand()->updateWriteCheck(); + for(auto& session : sessions_) { + session->addTextMessage(msg); + session->getCommand()->updateWriteCheck(); } }