mirror of
https://github.com/ceph/ceph
synced 2026-08-02 07:03:18 +00:00
include/CompatSet: get_name() returns std::string_view
Creating a temporary copy is useless overhead for all callers. Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
This commit is contained in:
parent
5a45cd213e
commit
7b5e7c4260
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user