From: Max Kellermann Date: Wed, 16 Oct 2024 15:25:53 +0000 (+0200) Subject: common/Formatter: use emplace_back() X-Git-Tag: v20.0.0~170^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1ae22591f30c7eeadcc7ce8cfbe3413a94985473;p=ceph.git common/Formatter: use emplace_back() This eliminates temporary `std::string` instances. Signed-off-by: Max Kellermann --- diff --git a/src/common/Formatter.cc b/src/common/Formatter.cc index ec358c2f244c..3a201ce654f7 100644 --- a/src/common/Formatter.cc +++ b/src/common/Formatter.cc @@ -83,7 +83,7 @@ FormatterAttrs::FormatterAttrs(const char *attr, ...) if (!val) break; - attrs.push_back(make_pair(std::string(s), std::string(val))); + attrs.emplace_back(s, val); s = va_arg(ap, char *); } while (s); va_end(ap);