aboutsummaryrefslogtreecommitdiffstats
path: root/src/directory.h
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-09-23 20:47:45 +0200
committerMax Kellermann <max@duempel.org>2008-09-23 20:47:45 +0200
commitd095d52ed4aadd916bd025e1c39bbe2977da3997 (patch)
treee42097120cc8c5aedf7a7a82158979522fe91ac2 /src/directory.h
parent3263dbe51793f355eeb51732396474c91feeb1ba (diff)
downloadmpd-d095d52ed4aadd916bd025e1c39bbe2977da3997.tar.gz
mpd-d095d52ed4aadd916bd025e1c39bbe2977da3997.tar.xz
mpd-d095d52ed4aadd916bd025e1c39bbe2977da3997.zip
Directory: don't allocate stat information dynamically
This should save a few thousand ops. Not worth it to malloc for such a small (3-words on 32-bit ARM and x86) structures. Signed-off-by: Eric Wong <normalperson@yhbt.net>
Diffstat (limited to '')
-rw-r--r--src/directory.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/directory.h b/src/directory.h
index be191bf5d..63ff6a548 100644
--- a/src/directory.h
+++ b/src/directory.h
@@ -23,17 +23,14 @@
typedef List DirectoryList;
-typedef struct _DirectoryStat {
- ino_t inode;
- dev_t device;
-} DirectoryStat;
-
typedef struct _Directory {
char *path;
DirectoryList *subDirectories;
SongList *songs;
struct _Directory *parent;
- DirectoryStat *stat;
+ ino_t inode;
+ dev_t device;
+ unsigned stat; /* not needed if ino_t == dev_t == 0 is impossible */
} Directory;
void readDirectoryDBIfUpdateIsFinished(void);