diff options
author | Max Kellermann <max@duempel.org> | 2013-09-05 19:11:50 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-09-26 17:35:08 +0200 |
commit | 52ee132d92d4a04d31bbbdeb7c6c0077bd2a2828 (patch) | |
tree | 098cf4f9385693b28e41c5342fcdfae416b058dd /src/tag/TagHandler.cxx | |
parent | 7ca0aedcfc35c784d7ae07cd1f1e8dce684e5901 (diff) | |
download | mpd-52ee132d92d4a04d31bbbdeb7c6c0077bd2a2828.tar.gz mpd-52ee132d92d4a04d31bbbdeb7c6c0077bd2a2828.tar.xz mpd-52ee132d92d4a04d31bbbdeb7c6c0077bd2a2828.zip |
TagHandler: use a TagBuilder internally
Reduce heap allocator overhead.
Diffstat (limited to 'src/tag/TagHandler.cxx')
-rw-r--r-- | src/tag/TagHandler.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/tag/TagHandler.cxx b/src/tag/TagHandler.cxx index 055fae49a..859f92b20 100644 --- a/src/tag/TagHandler.cxx +++ b/src/tag/TagHandler.cxx @@ -19,24 +19,24 @@ #include "config.h" #include "TagHandler.hxx" -#include "Tag.hxx" +#include "TagBuilder.hxx" #include <glib.h> static void add_tag_duration(unsigned seconds, void *ctx) { - Tag *tag = (Tag *)ctx; + TagBuilder &tag = *(TagBuilder *)ctx; - tag->time = seconds; + tag.SetTime(seconds); } static void add_tag_tag(enum tag_type type, const char *value, void *ctx) { - Tag *tag = (Tag *)ctx; + TagBuilder &tag = *(TagBuilder *)ctx; - tag->AddItem(type, value); + tag.AddItem(type, value); } const struct tag_handler add_tag_handler = { @@ -48,10 +48,10 @@ const struct tag_handler add_tag_handler = { static void full_tag_pair(const char *name, gcc_unused const char *value, void *ctx) { - Tag *tag = (Tag *)ctx; + TagBuilder &tag = *(TagBuilder *)ctx; if (g_ascii_strcasecmp(name, "cuesheet") == 0) - tag->has_playlist = true; + tag.SetHasPlaylist(true); } const struct tag_handler full_tag_handler = { |