[Spice-devel] [PATCH 10/15] dc: use while again

Frediano Ziglio fziglio at redhat.com
Mon May 16 16:40:35 UTC 2016


Convert from for(;;) { if () break; ... } to while

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 312d971..58c1fd6 100644
--- a/server/display-channel.c
+++ b/server/display-channel.c
@@ -509,10 +509,7 @@ static int current_add_equal(DisplayChannel *display, DrawItem *item, TreeItem *
             dpi_ring_item = ring_get_head(&other_drawable->pipes);
             /* dpi contains a sublist of dcc's, ordered the same */
             while (worker_ring_item) {
-                for (;;) {
-                    if (!worker_ring_item) {
-                        break;
-                    }
+                while (worker_ring_item) {
                     dcc = SPICE_CONTAINEROF(worker_ring_item, DisplayChannelClient,
                                             common.base.channel_link);
                     dpi = SPICE_CONTAINEROF(dpi_ring_item, RedDrawablePipeItem, base);
-- 
2.7.4



More information about the Spice-devel mailing list