From fd65bee759aee5a887e4051dd70513a6c01ed4a8 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Thu, 23 Apr 2015 17:10:28 +0200 Subject: [PATCH] virDomainObjListNew: Use virObjectFreeHashData There's no point in duplicating virObjectFreeHashData() in a separate function. Signed-off-by: Michal Privoznik --- 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 ccd3bdf64a..aad4ec05de 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; } -- GitLab