lib/alsa/AllowedFormat: use StringView::RemoveSuffix()

This commit is contained in:
Max Kellermann 2021-10-23 11:43:28 +02:00
parent b8890726f2
commit a9344fafe9

View File

@ -30,12 +30,7 @@ namespace Alsa {
AllowedFormat::AllowedFormat(StringView s) AllowedFormat::AllowedFormat(StringView s)
{ {
#ifdef ENABLE_DSD #ifdef ENABLE_DSD
const StringView dop_tail("=dop"); dop = s.RemoveSuffix("=dop");
if (s.EndsWith(dop_tail)) {
dop = true;
s.size -= dop_tail.size;
} else
dop = false;
#endif #endif
char buffer[64]; char buffer[64];