From eeed7f6e75131224d9a06b09ccd8de8e18b4ecfb Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Mon, 22 Feb 2016 07:59:25 +0100 Subject: [PATCH] virDomainDefFormatInternal: Drop useless check There's a check if a domain definition has any graphics card and if so, we iterate over each one of them. This makes no sense, because even if it has none we can still iterate over. Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index e47d613cca..56bd1aa990 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -22363,11 +22363,9 @@ virDomainDefFormatInternal(virDomainDefPtr def, goto error; } - if (def->ngraphics > 0) { - for (n = 0; n < def->ngraphics; n++) - if (virDomainGraphicsDefFormat(buf, def->graphics[n], flags) < 0) - goto error; - } + for (n = 0; n < def->ngraphics; n++) + if (virDomainGraphicsDefFormat(buf, def->graphics[n], flags) < 0) + goto error; for (n = 0; n < def->nsounds; n++) if (virDomainSoundDefFormat(buf, def->sounds[n], flags) < 0) -- GitLab