From: Travis Cross Date: Mon, 26 May 2014 18:43:23 +0000 (+0000) Subject: mod_fifo: Replace duplicate code with node_caller_count() X-Git-Tag: v1.4.5~2^2~14^2~15 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a5f982fd1c9019db11853d18736fc343245fb3f2;p=thirdparty%2Ffreeswitch.git mod_fifo: Replace duplicate code with node_caller_count() --- diff --git a/src/mod/applications/mod_fifo/mod_fifo.c b/src/mod/applications/mod_fifo/mod_fifo.c index 935431c20d..c1a8b27f74 100644 --- a/src/mod/applications/mod_fifo/mod_fifo.c +++ b/src/mod/applications/mod_fifo/mod_fifo.c @@ -674,15 +674,13 @@ static switch_status_t caller_read_frame_callback(switch_core_session_t *session static switch_status_t consumer_read_frame_callback(switch_core_session_t *session, switch_frame_t *frame, void *user_data) { fifo_node_t *node, **node_list = (fifo_node_t **) user_data; - int x = 0, total = 0, i = 0; + int total = 0, i = 0; for (i = 0;; i++) { if (!(node = node_list[i])) { break; } - for (x = 0; x < MAX_PRI; x++) { - total += fifo_queue_size(node->fifo_list[x]); - } + total += node_caller_count(node); } if (total) {