[Spice-devel] [PATCH 15/15] dc: use RING_FOREACH macro for loop
Frediano Ziglio
fziglio at redhat.com
Mon May 16 16:40:40 UTC 2016
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
server/display-channel.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/server/display-channel.c b/server/display-channel.c
index 608d176..65ca110 100644
--- a/server/display-channel.c
+++ b/server/display-channel.c
@@ -504,10 +504,9 @@ static int current_add_equal(DisplayChannel *display, DrawItem *item, TreeItem *
/* sending the drawable to clients that already received
* (or will receive) other_drawable */
- worker_ring_item = ring_get_head(&RED_CHANNEL(display)->clients);
dpi_ring_item = ring_get_head(&other_drawable->pipes);
/* dpi contains a sublist of dcc's, ordered the same */
- while (worker_ring_item) {
+ RING_FOREACH (worker_ring_item, &RED_CHANNEL(display)->clients) {
dcc = SPICE_CONTAINEROF(worker_ring_item, DisplayChannelClient,
common.base.channel_link);
if (dpi_ring_item && dcc == SPICE_CONTAINEROF(dpi_ring_item, RedDrawablePipeItem, base)->dcc) {
@@ -515,8 +514,6 @@ static int current_add_equal(DisplayChannel *display, DrawItem *item, TreeItem *
} else {
dcc_prepend_drawable(dcc, drawable);
}
- worker_ring_item = ring_next(&RED_CHANNEL(display)->clients,
- worker_ring_item);
}
/* not sending other_drawable where possible */
drawable_remove_from_pipes(other_drawable);
--
2.7.4
More information about the Spice-devel
mailing list