]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common/options: convert `long_desc` to C string 69098/head
authorMax Kellermann <max.kellermann@ionos.com>
Fri, 4 Oct 2024 11:56:29 +0000 (13:56 +0200)
committerMax Kellermann <max.kellermann@ionos.com>
Tue, 26 May 2026 11:02:27 +0000 (13:02 +0200)
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 <max.kellermann@ionos.com>
src/common/options.cc
src/common/options.h

index bbac26e261cd82fda562b3192f0ff3bbcc2eb3a1..d57dc4b9fb7428059f1fff9446099b6240fd0630 100644 (file)
@@ -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";
   }
 }
index f99433464bcdbc7541a19c8e87bb76ea90ea5445..e387e9d1c3a1704439d4fd9c2f0ea2d5b3009737 100644 (file)
@@ -167,7 +167,7 @@ struct Option {
   const level_t level;
 
   std::string desc;
-  std::string long_desc;
+  const char *long_desc = "";
 
   unsigned flags = 0;