aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-09 15:37:18 +0200
committerEric Wong <normalperson@yhbt.net>2008-10-11 19:21:49 -0700
commitf5edfa1a93af9a8692d45d076a2f45cc25d33d94 (patch)
tree34c6591945924ec2cdea5991bdf7dd9b1aec9ee9 /src
parent259f0fd80c9cf9eb06656dabcc6386a729d60127 (diff)
downloadmpd-f5edfa1a93af9a8692d45d076a2f45cc25d33d94.tar.gz
mpd-f5edfa1a93af9a8692d45d076a2f45cc25d33d94.tar.xz
mpd-f5edfa1a93af9a8692d45d076a2f45cc25d33d94.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..
Diffstat (limited to 'src')
-rw-r--r--src/directory_save.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/directory_save.c b/src/directory_save.c
index cd79e178b..76eace90b 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"
@@ -105,7 +104,7 @@ void 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))) {
+ if ((subdir = directory_get_child(directory, name))) {
assert(subdir->parent == directory);
} else {
subdir = directory_new(name, directory);