From 6ad80247ce7cf99d5084e3b8b39f56add37f911d Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Mon, 26 Dec 2011 22:22:55 -0800 Subject: [PATCH] Migrate killme to std::vector --- event.cpp | 43 ++++++++----------------------------------- 1 file changed, 8 insertions(+), 35 deletions(-) diff --git a/event.cpp b/event.cpp index 303c9cb30..0607ef1ef 100644 --- a/event.cpp +++ b/event.cpp @@ -72,7 +72,7 @@ static std::vector events; /** List of event handlers that should be removed */ -static array_list_t *killme; +static std::vector killme; /** List of events that have been sent but have not yet been delivered because they are blocked. @@ -312,10 +312,7 @@ void event_remove( event_t *criterion ) event_t *n = events.at(i); if( event_match( criterion, n ) ) { - if( !killme ) - killme = al_new(); - - al_push( killme, n ); + killme.push_back(n); /* If this event was a signal handler and no other handler handles @@ -370,16 +367,8 @@ int event_get( event_t *criterion, array_list_t *out ) */ static void event_free_kills() { - int i; - if( !killme ) - return; - - for( i=0; i