Switched to LiteralString for keys in subsonic responses

This commit is contained in:
emeric
2024-03-12 13:05:25 +01:00
parent eb7b622b71
commit 4e36e033e4
2 changed files with 13 additions and 23 deletions
+2 -12
View File
@@ -25,6 +25,7 @@
#include <variant>
#include <vector>
#include "utils/LiteralString.hpp"
#include "RequestContext.hpp"
namespace API::Subsonic
@@ -205,18 +206,7 @@ namespace API::Subsonic
class Node
{
public:
class Key
{
public:
template<std::size_t N>
constexpr Key(const char (&str)[N]) : _str{ str } {}
constexpr std::string_view get() const { return _str; }
bool constexpr operator<(const Key& other) const { return _str < other._str; }
private:
const std::string_view _str;
};
using Key = LiteralString;
void setAttribute(Key key, std::string_view value);