From d2cf74027c2c252181ab16c1348281c252665353 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 18 Jan 2014 19:08:39 +0100 Subject: 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%. --- src/SongUpdate.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/SongUpdate.cxx') diff --git a/src/SongUpdate.cxx b/src/SongUpdate.cxx index 669d0568d..dd01ea7d7 100644 --- a/src/SongUpdate.cxx +++ b/src/SongUpdate.cxx @@ -98,8 +98,7 @@ Song::UpdateFile() mtime = st.st_mtime; - delete tag; - tag = tag_builder.CommitNew(); + tag_builder.Commit(tag); return true; } @@ -123,8 +122,7 @@ Song::UpdateFileInArchive() if (!tag_stream_scan(path_fs.c_str(), full_tag_handler, &tag_builder)) return false; - delete tag; - tag = tag_builder.CommitNew(); + tag_builder.Commit(tag); return true; } -- cgit v1.2.3