diff options
author | Max Kellermann <max@duempel.org> | 2008-10-08 10:48:49 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-10-08 10:48:49 +0200 |
commit | e79aacf1db334ba920de0732631e999ab8144721 (patch) | |
tree | 2232c970f8f723eddae734fc722aa2ec85d9b4f3 /src/directory.c | |
parent | 7b9bed8398137e90538908a24467633029b1c307 (diff) | |
download | mpd-e79aacf1db334ba920de0732631e999ab8144721.tar.gz mpd-e79aacf1db334ba920de0732631e999ab8144721.tar.xz mpd-e79aacf1db334ba920de0732631e999ab8144721.zip |
directory: added directory_is_empty()
directory_is_empty() is a tiny inline function which determine if a
directory has any child objects (sub directories or songs).
Diffstat (limited to '')
-rw-r--r-- | src/directory.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/directory.c b/src/directory.c index 9913154e2..d1f0e3300 100644 --- a/src/directory.c +++ b/src/directory.c @@ -89,7 +89,7 @@ static void deleteEmptyDirectoriesInDirectory(Directory * directory) for (i = dv->nr; --i >= 0; ) { deleteEmptyDirectoriesInDirectory(dv->base[i]); - if (!dv->base[i]->children.nr && !dv->base[i]->songs.nr) + if (directory_is_empty(dv->base[i])) dirvec_delete(dv, dv->base[i]); } if (!dv->nr) |