aboutsummaryrefslogtreecommitdiffstats
path: root/src/db/update/Editor.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/db/update/Editor.cxx')
-rw-r--r--src/db/update/Editor.cxx17
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