From 120aa4bfb5c0b6962ee50559c0263f8e850f2c88 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 9 Oct 2008 19:14:04 +0200 Subject: update: copy stat to new directory When reading a new directory, copy the stat data (which we have anyway) to the directory struct. This may save a stat() in the future. --- src/update.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/update.c b/src/update.c index 410d906ff..c8eb33b6d 100644 --- a/src/update.c +++ b/src/update.c @@ -361,7 +361,9 @@ directory_make_child_checked(struct directory *parent, const char *path) if ((conflicting = songvec_find(&parent->songs, mpd_basename(path)))) delete_song(parent, conflicting); - return directory_new_child(parent, path); + directory = directory_new_child(parent, path); + directory_set_stat(directory, &st); + return directory; } static struct directory * -- cgit v1.2.3