lib/alsa/AllowedFormat: use std::string_view
This commit is contained in:
@@ -54,7 +54,7 @@ AllowedFormat::AllowedFormat(StringView s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::forward_list<AllowedFormat>
|
std::forward_list<AllowedFormat>
|
||||||
AllowedFormat::ParseList(StringView s)
|
AllowedFormat::ParseList(std::string_view s)
|
||||||
{
|
{
|
||||||
std::forward_list<AllowedFormat> list;
|
std::forward_list<AllowedFormat> list;
|
||||||
auto tail = list.before_begin();
|
auto tail = list.before_begin();
|
||||||
|
@@ -52,7 +52,7 @@ struct AllowedFormat {
|
|||||||
*
|
*
|
||||||
* Throws std::runtime_error on error.
|
* Throws std::runtime_error on error.
|
||||||
*/
|
*/
|
||||||
static std::forward_list<AllowedFormat> ParseList(StringView s);
|
static std::forward_list<AllowedFormat> ParseList(std::string_view s);
|
||||||
};
|
};
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
|
@@ -471,7 +471,7 @@ AlsaOutput::SetAttribute(std::string &&name, std::string &&value)
|
|||||||
{
|
{
|
||||||
if (name == "allowed_formats") {
|
if (name == "allowed_formats") {
|
||||||
const std::lock_guard<Mutex> lock(attributes_mutex);
|
const std::lock_guard<Mutex> lock(attributes_mutex);
|
||||||
allowed_formats = Alsa::AllowedFormat::ParseList({value.data(), value.length()});
|
allowed_formats = Alsa::AllowedFormat::ParseList(value);
|
||||||
#ifdef ENABLE_DSD
|
#ifdef ENABLE_DSD
|
||||||
} else if (name == "dop") {
|
} else if (name == "dop") {
|
||||||
const std::lock_guard<Mutex> lock(attributes_mutex);
|
const std::lock_guard<Mutex> lock(attributes_mutex);
|
||||||
|
Reference in New Issue
Block a user