diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2015-08-26 19:33:52 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2015-08-26 19:33:52 +0100 |
| commit | 0c41c141875dd91a12e20fa99fc7876d0ee8a792 (patch) | |
| tree | 8c7ce52dc9344688d39ddf6bffa0a40a888be55a /src/client_manager.cc | |
| parent | 3552152b34d64246ecb1003314a1040161fe3e97 (diff) | |
Reorganize slightly local client creation
Diffstat (limited to 'src/client_manager.cc')
| -rw-r--r-- | src/client_manager.cc | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/client_manager.cc b/src/client_manager.cc index 922ee250..927c1c0e 100644 --- a/src/client_manager.cc +++ b/src/client_manager.cc @@ -66,15 +66,11 @@ void ClientManager::handle_pending_inputs() const void ClientManager::remove_client(Client& client) { - for (auto it = m_clients.begin(); it != m_clients.end(); ++it) - { - if (it->get() == &client) - { - m_clients.erase(it); - return; - } - } - kak_assert(false); + auto it = find_if(m_clients, + [&](const std::unique_ptr<Client>& ptr) + { return ptr.get() == &client; }); + kak_assert(it != m_clients.end()); + m_clients.erase(it); } WindowAndSelections ClientManager::get_free_window(Buffer& buffer) |
