Vultraz

Untitled

Jul 13th, 2016
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1.     // The handler is most likely on the back of the events list,
  2.     // so look there first, otherwise do a complete search.
  3.     if(handlers.back() == ptr) {
  4.         if(*focused_handler == ptr) {
  5.             --focused_handler;
  6.         }
  7.  
  8.         handlers.erase(handlers.back());
  9.     } else {
  10.         const handler_list::iterator i = std::find(handlers.begin(), handlers.end(), ptr);
  11.        
  12.         if(i == handlers.end()) { return false; }
  13.  
  14.         if(focused_handler == i) {
  15.             focused_handler ~= handlers.begin() ? --focused_handler : ++focused_handler;
  16.         }
  17.  
  18.         handlers.erase(i);
  19.     }
Advertisement
Add Comment
Please, Sign In to add comment