diff options
author | Max Kellermann <max@duempel.org> | 2008-10-09 15:37:18 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-10-09 15:37:18 +0200 |
commit | 60d122e850f928f03fffbf4b31c9f1b25fd4b318 (patch) | |
tree | 2017cbc0548bdb88c2c8c9348d8487bf5dba2713 | |
parent | 702739b879e1515fad571df0590be3e3f1e22cae (diff) | |
download | mpd-60d122e850f928f03fffbf4b31c9f1b25fd4b318.tar.gz mpd-60d122e850f928f03fffbf4b31c9f1b25fd4b318.tar.xz mpd-60d122e850f928f03fffbf4b31c9f1b25fd4b318.zip |
directory: don't query database during load
Don't use db_get_directory() and traverse the full path with every
directory being loaded. Just see if the current parent contains the
entry. Everything else would be invalid anyway..
-rw-r--r-- | src/directory_save.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/directory_save.c b/src/directory_save.c index 00cf5f8e0..51c51c48c 100644 --- a/src/directory_save.c +++ b/src/directory_save.c @@ -18,7 +18,6 @@ #include "directory_save.h" #include "directory.h" -#include "database.h" #include "song.h" #include "log.h" #include "path.h" @@ -88,7 +87,8 @@ directory_load(FILE *fp, struct directory *directory) FATAL("Wrong path in database: '%s' in '%s'\n", name, directory->path); - if ((subdir = db_get_directory(name))) { + subdir = directory_get_child(directory, name); + if (subdir != NULL) { assert(subdir->parent == directory); } else { subdir = directory_new(name, directory); |