IcyMetaDataParser: pass StringView to icy_add_item()
This commit is contained in:
parent
d663f81420
commit
d8bcdca7ff
@ -67,18 +67,16 @@ IcyMetaDataParser::Data(size_t length) noexcept
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
icy_add_item(TagBuilder &tag, TagType type, const char *value) noexcept
|
icy_add_item(TagBuilder &tag, TagType type, StringView value) noexcept
|
||||||
{
|
{
|
||||||
size_t length = strlen(value);
|
if (value.size >= 2 && value.front() == '\'' && value.back() == '\'') {
|
||||||
|
|
||||||
if (length >= 2 && value[0] == '\'' && value[length - 1] == '\'') {
|
|
||||||
/* strip the single quotes */
|
/* strip the single quotes */
|
||||||
++value;
|
++value.data;
|
||||||
length -= 2;
|
value.size -= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (length > 0)
|
if (value.size > 0)
|
||||||
tag.AddItem(type, {value, length});
|
tag.AddItem(type, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user