mirror of
https://github.com/ceph/ceph
synced 2026-08-02 07:03:18 +00:00
include/CompatSet: use std::string_view in struct Feature
Almost all callers pass a C string (in temporary Feature instances), only `CompatSetHandler::handle()` passes a `std::string` reference. Allocating a new `std::string` is useless overhead. This patch reduces the binary size by 21 kB. Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
This commit is contained in:
parent
8023e9f5df
commit
5a45cd213e
@ -29,9 +29,9 @@ struct CompatSet {
|
||||
|
||||
struct Feature {
|
||||
uint64_t id;
|
||||
std::string name;
|
||||
std::string_view name;
|
||||
|
||||
Feature(uint64_t _id, const std::string& _name) : id(_id), name(_name) {}
|
||||
constexpr Feature(uint64_t _id, const std::string_view _name) : id(_id), name(_name) {}
|
||||
};
|
||||
|
||||
class FeatureSet {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user