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>
This commit is contained in:

committed by
Max Kellermann

parent
3263dbe517
commit
d095d52ed4
@@ -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);
|
||||
|
Reference in New Issue
Block a user