From: Max Kellermann Date: Fri, 4 Oct 2024 11:56:29 +0000 (+0200) Subject: common/options: convert `long_desc` to C string X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fdf82a5d8d316db98c8721b7bc931658e16299ae;p=ceph.git common/options: convert `long_desc` to C string All parameters are C strings (either C literals, except for MgrMonitor::update_from_paxos()) and there's no point in copying all of them onto the heap during startup. Signed-off-by: Max Kellermann --- diff --git a/src/common/options.cc b/src/common/options.cc index bbac26e261cd..d57dc4b9fb74 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -333,7 +333,7 @@ void Option::print(ostream *out) const *out << " See also: " << see_also << "\n"; } - if (long_desc.size()) { + if (*long_desc != '\0') { *out << "\n" << long_desc << "\n"; } } diff --git a/src/common/options.h b/src/common/options.h index f99433464bcd..e387e9d1c3a1 100644 --- a/src/common/options.h +++ b/src/common/options.h @@ -167,7 +167,7 @@ struct Option { const level_t level; std::string desc; - std::string long_desc; + const char *long_desc = ""; unsigned flags = 0;