From: Max Kellermann Date: Wed, 16 Oct 2024 18:01:20 +0000 (+0200) Subject: include/CompatSet: get_name() returns std::string_view X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7b5e7c42605dfde5c2256d628f71a8f586f7b403;p=ceph.git include/CompatSet: get_name() returns std::string_view Creating a temporary copy is useless overhead for all callers. Signed-off-by: Max Kellermann --- diff --git a/src/include/CompatSet.h b/src/include/CompatSet.h index 24cadd6ab57..f56ce49aa4d 100644 --- a/src/include/CompatSet.h +++ b/src/include/CompatSet.h @@ -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::const_iterator i = names.find(f); ceph_assert(i != names.end()); return i->second;