From: Michal Privoznik Date: Tue, 19 Jul 2022 12:02:52 +0000 (+0200) Subject: domain_conf: Switch to virBufferAddLit for literal strings X-Git-Tag: v8.6.0-rc1~66 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a9d1c08b713fd58fcfbf40f5ebddc802ab467d39;p=thirdparty%2Flibvirt.git domain_conf: Switch to virBufferAddLit for literal strings There's no need to use virBufferAddStr() for literal strings without any newline character as it's more expensive than virBufferAddLit(). Signed-off-by: Michal Privoznik Reviewed-by: Tim Wiederhake --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 4c7a5a044c..44a01ab628 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -25376,7 +25376,7 @@ virDomainGraphicsDefFormat(virBuffer *buf, case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NONE: if (flags & VIR_DOMAIN_DEF_FORMAT_MIGRATABLE) - virBufferAddStr(buf, " autoport='no'"); + virBufferAddLit(buf, " autoport='no'"); break; case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_SOCKET: @@ -25388,7 +25388,7 @@ virDomainGraphicsDefFormat(virBuffer *buf, * parsed as listen type "none". */ if ((flags & VIR_DOMAIN_DEF_FORMAT_MIGRATABLE) && glisten->fromConfig) { - virBufferAddStr(buf, " autoport='yes'"); + virBufferAddLit(buf, " autoport='yes'"); } break;