]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
include/CompatSet: get_name() returns std::string_view
authorMax Kellermann <max.kellermann@ionos.com>
Wed, 16 Oct 2024 18:01:20 +0000 (20:01 +0200)
committerMax Kellermann <max.kellermann@ionos.com>
Thu, 28 May 2026 06:22:35 +0000 (08:22 +0200)
Creating a temporary copy is useless overhead for all callers.

Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
src/include/CompatSet.h

index 24cadd6ab57449e1429a66cbe35d4aa041c9558c..f56ce49aa4d135df2056a9b658934ada89801dff 100644 (file)
@@ -62,7 +62,7 @@ struct CompatSet {
     /**
      * Getter instead of using name[] to be const safe
      */
-    std::string get_name(uint64_t const f) const {
+    std::string_view get_name(uint64_t const f) const noexcept {
       std::map<uint64_t, std::string>::const_iterator i = names.find(f);
       ceph_assert(i != names.end());
       return i->second;