Adding break when sorted_workspaces is filled

This commit is contained in:
Lucas Lazare 2019-05-18 12:09:30 -04:00
parent 8ba3052dd1
commit 863e0babd8
1 changed files with 3 additions and 0 deletions

View File

@ -99,6 +99,9 @@ void Workspaces::onCmd(const struct Ipc::ipc_response &res) {
if (it != ws_end) { if (it != ws_end) {
sorted_workspaces.emplace_back(*it); sorted_workspaces.emplace_back(*it);
--ws_end; --ws_end;
if (ws_end == workspaces_.begin()) { // we've extracted everything
break;
}
ws_end->swap(*it); ws_end->swap(*it);
} }
} }