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%.
This commit is contained in:
@@ -53,8 +53,7 @@ song_save(FILE *fp, const Song &song)
|
||||
|
||||
range_save(fp, song.start_ms, song.end_ms);
|
||||
|
||||
if (song.tag != nullptr)
|
||||
tag_save(fp, *song.tag);
|
||||
tag_save(fp, song.tag);
|
||||
|
||||
fprintf(fp, SONG_MTIME ": %li\n", (long)song.mtime);
|
||||
fprintf(fp, SONG_END "\n");
|
||||
|
Reference in New Issue
Block a user