From b8890726f2f55d8e24d2e8dde6e5304be9b2a97a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 23 Oct 2021 11:41:24 +0200 Subject: [PATCH] lib/alsa/AllowedFormat: use std::string_view --- src/lib/alsa/AllowedFormat.cxx | 2 +- src/lib/alsa/AllowedFormat.hxx | 2 +- src/output/plugins/AlsaOutputPlugin.cxx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/alsa/AllowedFormat.cxx b/src/lib/alsa/AllowedFormat.cxx index c8e3dd3d8..1dc0d065d 100644 --- a/src/lib/alsa/AllowedFormat.cxx +++ b/src/lib/alsa/AllowedFormat.cxx @@ -54,7 +54,7 @@ AllowedFormat::AllowedFormat(StringView s) } std::forward_list -AllowedFormat::ParseList(StringView s) +AllowedFormat::ParseList(std::string_view s) { std::forward_list list; auto tail = list.before_begin(); diff --git a/src/lib/alsa/AllowedFormat.hxx b/src/lib/alsa/AllowedFormat.hxx index a864835ab..d54e91d60 100644 --- a/src/lib/alsa/AllowedFormat.hxx +++ b/src/lib/alsa/AllowedFormat.hxx @@ -52,7 +52,7 @@ struct AllowedFormat { * * Throws std::runtime_error on error. */ - static std::forward_list ParseList(StringView s); + static std::forward_list ParseList(std::string_view s); }; std::string diff --git a/src/output/plugins/AlsaOutputPlugin.cxx b/src/output/plugins/AlsaOutputPlugin.cxx index 4cb5534c1..d42c4bda4 100644 --- a/src/output/plugins/AlsaOutputPlugin.cxx +++ b/src/output/plugins/AlsaOutputPlugin.cxx @@ -471,7 +471,7 @@ AlsaOutput::SetAttribute(std::string &&name, std::string &&value) { if (name == "allowed_formats") { const std::lock_guard lock(attributes_mutex); - allowed_formats = Alsa::AllowedFormat::ParseList({value.data(), value.length()}); + allowed_formats = Alsa::AllowedFormat::ParseList(value); #ifdef ENABLE_DSD } else if (name == "dop") { const std::lock_guard lock(attributes_mutex);