Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // The handler is most likely on the back of the events list,
- // so look there first, otherwise do a complete search.
- if(handlers.back() == ptr) {
- if(*focused_handler == ptr) {
- --focused_handler;
- }
- handlers.erase(handlers.back());
- } else {
- const handler_list::iterator i = std::find(handlers.begin(), handlers.end(), ptr);
- if(i == handlers.end()) { return false; }
- if(focused_handler == i) {
- focused_handler ~= handlers.begin() ? --focused_handler : ++focused_handler;
- }
- handlers.erase(i);
- }
Advertisement
Add Comment
Please, Sign In to add comment