diff options
author | Max Kellermann <max@duempel.org> | 2014-06-10 21:15:40 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-06-16 18:39:16 +0200 |
commit | 3ca0a39a357d9be9c85de4892ac02716f8af2ae8 (patch) | |
tree | 88c87573974f6609a1dc68cf20e5901600613280 /src/db/plugins/simple/DirectorySave.cxx | |
parent | 52594e64d0f48eb83c9bf54eb1ac95a6de881829 (diff) | |
download | mpd-3ca0a39a357d9be9c85de4892ac02716f8af2ae8.tar.gz mpd-3ca0a39a357d9be9c85de4892ac02716f8af2ae8.tar.xz mpd-3ca0a39a357d9be9c85de4892ac02716f8af2ae8.zip |
db/simple: use class boost::intrusive::list
Remove the C list_head library and use type-safe C++ instead.
Diffstat (limited to 'src/db/plugins/simple/DirectorySave.cxx')
-rw-r--r-- | src/db/plugins/simple/DirectorySave.cxx | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/db/plugins/simple/DirectorySave.cxx b/src/db/plugins/simple/DirectorySave.cxx index b5989dd06..9d3ebbac2 100644 --- a/src/db/plugins/simple/DirectorySave.cxx +++ b/src/db/plugins/simple/DirectorySave.cxx @@ -84,20 +84,18 @@ directory_save(FILE *fp, const Directory &directory) fprintf(fp, "%s%s\n", DIRECTORY_BEGIN, directory.GetPath()); } - Directory *cur; - directory_for_each_child(cur, directory) { - fprintf(fp, DIRECTORY_DIR "%s\n", cur->GetName()); + for (const auto &child : directory.children) { + fprintf(fp, DIRECTORY_DIR "%s\n", child.GetName()); - if (!cur->IsMount()) - directory_save(fp, *cur); + if (!child.IsMount()) + directory_save(fp, child); if (ferror(fp)) return; } - Song *song; - directory_for_each_song(song, directory) - song_save(fp, *song); + for (const auto &song : directory.songs) + song_save(fp, song); playlist_vector_save(fp, directory.playlists); |