SongSave: return DetachedSong, not a std::unique_ptr<>

Eliminate unnecessary dynamic allocations.
This commit is contained in:
Max Kellermann
2019-09-05 20:50:00 +02:00
parent a1e2602c3d
commit 07f212c98c
4 changed files with 12 additions and 12 deletions

View File

@@ -165,7 +165,7 @@ directory_load(TextFile &file, Directory &directory)
auto detached_song = song_load(file, name,
&audio_format);
auto song = std::make_unique<Song>(std::move(*detached_song),
auto song = std::make_unique<Song>(std::move(detached_song),
directory);
song->audio_format = audio_format;