tag/IcyMetadataParser: pass std::string_view to icy_parse_tag_item()

This commit is contained in:
Max Kellermann 2023-12-20 19:50:08 +01:00
parent 03352cb4ad
commit 2618294eb7

View File

@ -7,9 +7,12 @@
#include <algorithm> #include <algorithm>
#include <cassert> #include <cassert>
#include <string_view>
#include <string.h> #include <string.h>
using std::string_view_literals::operator""sv;
#ifdef HAVE_ICU_CONVERTER #ifdef HAVE_ICU_CONVERTER
void void
@ -72,9 +75,9 @@ icy_parse_tag_item(TagBuilder &tag,
#ifdef HAVE_ICU_CONVERTER #ifdef HAVE_ICU_CONVERTER
const IcuConverter *icu_converter, const IcuConverter *icu_converter,
#endif #endif
const char *name, const char *value) noexcept std::string_view name, std::string_view value) noexcept
{ {
if (strcmp(name, "StreamTitle") == 0) { if (name == "StreamTitle"sv) {
#ifdef HAVE_ICU_CONVERTER #ifdef HAVE_ICU_CONVERTER
if (icu_converter != nullptr) { if (icu_converter != nullptr) {
try { try {