[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 2/5] virDomainObjListNew: Use virObjectFreeHashData



There's no point in duplicating virObjectFreeHashData() in a separate
function.

Signed-off-by: Michal Privoznik <mprivozn redhat com>
---
 src/conf/domain_conf.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index ccd3bdf..aad4ec0 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -1032,13 +1032,6 @@ virDomainDeviceDefCheckUnsupportedMemoryDevice(virDomainDeviceDefPtr dev)
 }
 
 
-static void
-virDomainObjListDataFree(void *payload, const void *name ATTRIBUTE_UNUSED)
-{
-    virDomainObjPtr obj = payload;
-    virObjectUnref(obj);
-}
-
 virDomainObjListPtr virDomainObjListNew(void)
 {
     virDomainObjListPtr doms;
@@ -1049,7 +1042,7 @@ virDomainObjListPtr virDomainObjListNew(void)
     if (!(doms = virObjectLockableNew(virDomainObjListClass)))
         return NULL;
 
-    if (!(doms->objs = virHashCreate(50, virDomainObjListDataFree))) {
+    if (!(doms->objs = virHashCreate(50, virObjectFreeHashData))) {
         virObjectUnref(doms);
         return NULL;
     }
-- 
2.0.5


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]