diff options
author | Max Kellermann <max@duempel.org> | 2014-01-18 19:08:39 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-01-19 02:58:55 +0100 |
commit | d2cf74027c2c252181ab16c1348281c252665353 (patch) | |
tree | 50dc8efe859419ad9f266bc277049bae34790c78 /src/db | |
parent | bc966577ffb2354f44ebb85ceb83b188bb6907b6 (diff) | |
download | mpd-d2cf74027c2c252181ab16c1348281c252665353.tar.gz mpd-d2cf74027c2c252181ab16c1348281c252665353.tar.xz mpd-d2cf74027c2c252181ab16c1348281c252665353.zip |
Song: embed the Tag object statically into class Song
Reduces overhead because we need to manage only one memory allocation.
According to valgrind/massif, we save 7%.
Diffstat (limited to 'src/db')
-rw-r--r-- | src/db/ProxyDatabasePlugin.cxx | 2 | ||||
-rw-r--r-- | src/db/UpnpDatabasePlugin.cxx | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/db/ProxyDatabasePlugin.cxx b/src/db/ProxyDatabasePlugin.cxx index 9f4d3d31c..4b44d9a87 100644 --- a/src/db/ProxyDatabasePlugin.cxx +++ b/src/db/ProxyDatabasePlugin.cxx @@ -524,7 +524,7 @@ Convert(const struct mpd_song *song) for (const auto *i = &tag_table[0]; i->d != TAG_NUM_OF_ITEM_TYPES; ++i) Copy(tag, i->d, song, i->s); - s->tag = tag.CommitNew(); + tag.Commit(s->tag); return s; } diff --git a/src/db/UpnpDatabasePlugin.cxx b/src/db/UpnpDatabasePlugin.cxx index c1066fb7a..dbf04f818 100644 --- a/src/db/UpnpDatabasePlugin.cxx +++ b/src/db/UpnpDatabasePlugin.cxx @@ -205,7 +205,7 @@ upnpItemToSong(UPnPDirObject &&dirent, const char *uri) uri = dirent.url.c_str(); Song *s = Song::NewFile(uri, nullptr); - s->tag = new Tag(std::move(dirent.tag)); + s->tag = std::move(dirent.tag); return s; } |