Use a macro to simplify ring_get_length

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
This commit is contained in:
Frediano Ziglio 2016-06-20 16:21:32 +01:00
parent 57570953dc
commit 15b8f28c14

View File

@ -155,9 +155,7 @@ static inline unsigned int ring_get_length(Ring *ring)
RingItem *i;
unsigned int ret = 0;
for (i = ring_get_head(ring);
i != NULL;
i = ring_next(ring, i))
RING_FOREACH(i, ring)
ret++;
return ret;