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/update/Editor.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/update/Editor.cxx')
-rw-r--r-- | src/db/update/Editor.cxx | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/db/update/Editor.cxx b/src/db/update/Editor.cxx index c3c1a23d6..4136ccdad 100644 --- a/src/db/update/Editor.cxx +++ b/src/db/update/Editor.cxx @@ -64,15 +64,14 @@ DatabaseEditor::LockDeleteSong(Directory &parent, Song *song) inline void DatabaseEditor::ClearDirectory(Directory &directory) { - Directory *child, *n; - directory_for_each_child_safe(child, n, directory) - DeleteDirectory(child); - - Song *song, *ns; - directory_for_each_song_safe(song, ns, directory) { - assert(song->parent == &directory); - DeleteSong(directory, song); - } + directory.ForEachChildSafe([this](Directory &child){ + DeleteDirectory(&child); + }); + + directory.ForEachSongSafe([this, &directory](Song &song){ + assert(song.parent == &directory); + DeleteSong(directory, &song); + }); } void |