aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-09 19:14:04 +0200
committerEric Wong <normalperson@yhbt.net>2008-10-11 19:21:51 -0700
commit120aa4bfb5c0b6962ee50559c0263f8e850f2c88 (patch)
tree9816d60cd1d150a195850854b4cbf44017861321 /src
parente2d7fa53aa587b874709d441ecc782f745fd4b3e (diff)
downloadmpd-120aa4bfb5c0b6962ee50559c0263f8e850f2c88.tar.gz
mpd-120aa4bfb5c0b6962ee50559c0263f8e850f2c88.tar.xz
mpd-120aa4bfb5c0b6962ee50559c0263f8e850f2c88.zip
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.
Diffstat (limited to '')
-rw-r--r--src/update.c4
1 files changed, 3 insertions, 1 deletions
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 *