diff options
| author | Nils Maier <maierman@web.de> | 2013-08-21 06:06:10 +0200 |
|---|---|---|
| committer | Nils Maier <maierman@web.de> | 2013-08-21 07:32:01 +0200 |
| commit | cf6f58ceece4c85760c82b78c4872dba331ddfc6 (patch) | |
| tree | c0a279e8384dc413697320ff1740707bb9d9efa2 /src/LibuvEventPoll.cc | |
| parent | 8526ceeb452d23d7aa73d01c6cb0fc8ae5e0377b (diff) | |
More code cleanups
Diffstat (limited to 'src/LibuvEventPoll.cc')
| -rw-r--r-- | src/LibuvEventPoll.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/LibuvEventPoll.cc b/src/LibuvEventPoll.cc index 07d60a1e..791d8521 100644 --- a/src/LibuvEventPoll.cc +++ b/src/LibuvEventPoll.cc @@ -107,8 +107,8 @@ LibuvEventPoll::LibuvEventPoll() LibuvEventPoll::~LibuvEventPoll() { - for (KPolls::iterator i = polls_.begin(), e = polls_.end(); i != e; ++i) { - i->second->close(); + for (auto& p: polls_) { + p.second->close(); } // Actually kill the polls, and timers, if any. uv_run(loop_, (uv_run_mode)(UV_RUN_ONCE | UV_RUN_NOWAIT)); @@ -256,8 +256,8 @@ bool LibuvEventPoll::addEvents(sock_t socket, Command* command, int events, bool LibuvEventPoll::deleteEvents(sock_t socket, const LibuvEventPoll::KEvent& event) { - std::shared_ptr<KSocketEntry> socketEntry(new KSocketEntry(socket)); - KSocketEntrySet::iterator i = socketEntries_.find(socketEntry); + auto socketEntry = std::make_shared<KSocketEntry>(socket); + auto i = socketEntries_.find(socketEntry); if (i == socketEntries_.end()) { A2_LOG_DEBUG(fmt("Socket %d is not found in SocketEntries.", socket)); @@ -266,7 +266,7 @@ bool LibuvEventPoll::deleteEvents(sock_t socket, event.removeSelf(*i); - KPolls::iterator poll = polls_.find(socket); + auto poll = polls_.find(socket); if (poll == polls_.end()) { return false; } |
