[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] block: remove redundant check before g_slist_find()
From: |
Alberto Garcia |
Subject: |
[Qemu-devel] [PATCH] block: remove redundant check before g_slist_find() |
Date: |
Mon, 29 Jun 2015 16:12:13 +0300 |
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 <address@hidden>
---
block/io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/io.c b/block/io.c
index e295992..2f7f889 100644
--- a/block/io.c
+++ b/block/io.c
@@ -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);
}
}
--
2.1.4
- [Qemu-devel] [PATCH] block: remove redundant check before g_slist_find(),
Alberto Garcia <=