tag/TagHandler: pass by reference
This commit is contained in:
@@ -77,7 +77,7 @@ ForEachValue(const char *value, const char *end, C &&callback)
|
||||
static bool
|
||||
tag_ape_import_item(unsigned long flags,
|
||||
const char *key, StringView value,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
/* we only care about utf-8 text tags */
|
||||
if ((flags & (0x3 << 1)) != 0)
|
||||
@@ -86,10 +86,10 @@ tag_ape_import_item(unsigned long flags,
|
||||
const auto begin = value.begin();
|
||||
const auto end = value.end();
|
||||
|
||||
if (handler->pair != nullptr)
|
||||
if (handler.pair != nullptr)
|
||||
ForEachValue(begin, end, [handler, handler_ctx,
|
||||
key](const char *_value) {
|
||||
handler->pair(key, _value, handler_ctx);
|
||||
handler.pair(key, _value, handler_ctx);
|
||||
});
|
||||
|
||||
TagType type = tag_ape_name_parse(key);
|
||||
@@ -107,7 +107,7 @@ tag_ape_import_item(unsigned long flags,
|
||||
|
||||
bool
|
||||
tag_ape_scan2(InputStream &is,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
bool recognized = false;
|
||||
|
||||
@@ -124,7 +124,7 @@ tag_ape_scan2(InputStream &is,
|
||||
|
||||
bool
|
||||
tag_ape_scan2(Path path_fs,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
bool recognized = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user