[asterisk-commits] twilson: branch twilson/calendaring r161415 - /team/twilson/calendaring/main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Dec 5 14:15:58 CST 2008


Author: twilson
Date: Fri Dec  5 14:15:58 2008
New Revision: 161415

URL: http://svn.digium.com/view/asterisk?view=rev&rev=161415
Log:
Replace another ao2_iterator instance with ao2_callback as per russell on reviewboard

Modified:
    team/twilson/calendaring/main/calendar.c

Modified: team/twilson/calendaring/main/calendar.c
URL: http://svn.digium.com/view/asterisk/team/twilson/calendaring/main/calendar.c?view=diff&rev=161415&r1=161414&r2=161415
==============================================================================
--- team/twilson/calendaring/main/calendar.c (original)
+++ team/twilson/calendaring/main/calendar.c Fri Dec  5 14:15:58 2008
@@ -292,18 +292,16 @@
 	return;
 }
 
+static int cb_true(void *user_data, void *arg, int flags)
+{
+	return CMP_MATCH;
+}
+
 void ast_calendar_clear_events(struct ast_calendar *cal)
 {
-	struct ast_calendar_event *event;
-	struct ao2_iterator i;
-
 	ast_debug(3, "Clearing all events for calendar %s\n", cal->name);
 
-	i = ao2_iterator_init(cal->events, 0);
-	while ((event = ao2_iterator_next(&i))) {
-		ao2_unlink(cal->events, event);
-		event = ast_calendar_unref_event(event);
-	}
+	ao2_callback(cal->events, OBJ_UNLINK | OBJ_NODATA | OBJ_MULTIPLE, cb_true, NULL); 
 }
 
 struct ast_calendar_event *ast_calendar_event_alloc(struct ast_calendar *cal)




More information about the asterisk-commits mailing list