]> Git Repo - qemu.git/commitdiff
block: remove redundant check before g_slist_find()
authorAlberto Garcia <[email protected]>
Mon, 29 Jun 2015 13:12:13 +0000 (16:12 +0300)
committerStefan Hajnoczi <[email protected]>
Thu, 2 Jul 2015 09:06:23 +0000 (10:06 +0100)
An empty GSList is represented by a NULL pointer, therefore it's a
perfectly valid argument for g_slist_find() and there's no need to
make any additional check.

Signed-off-by: Alberto Garcia <[email protected]>
Message-id: 1435583533[email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>
block/io.c

index ad31822b08174e3750930b79b2d893ecff69e235..305e0d952e23267982ef9b5b18c3b6e422b6a10d 100644 (file)
@@ -283,7 +283,7 @@ void bdrv_drain_all(void)
         }
         aio_context_release(aio_context);
 
-        if (!aio_ctxs || !g_slist_find(aio_ctxs, aio_context)) {
+        if (!g_slist_find(aio_ctxs, aio_context)) {
             aio_ctxs = g_slist_prepend(aio_ctxs, aio_context);
         }
     }
This page took 0.027505 seconds and 4 git commands to generate.