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>
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 {