forked from len0rd/rockbox
hosted/multidrive: Speed up readdir()/get_dir_info().
The two functions need to check whether they are called for a specific path to implement the virtual mount point for the external storage. This is statistically rare and a hit on the common case. Therefore speed up the common case by performing integer comparision first, and only expensive string construction and comparision if that succeeds. Change-Id: I3c41fe073e1f4f8eb62d2b8556a36937c9cb8290
This commit is contained in:
parent
3a3d26eee2
commit
c27c3f10fd
2 changed files with 37 additions and 18 deletions
|
|
@ -55,8 +55,6 @@
|
|||
#define PLUGIN_DIR ROCKBOX_DIR "/rocks"
|
||||
#define CODECS_DIR ROCKBOX_DIR "/codecs"
|
||||
|
||||
#define paths_init()
|
||||
|
||||
#else /* APPLICATION */
|
||||
|
||||
#define HOME_DIR "<HOME>" /* replaced at runtime */
|
||||
|
|
@ -68,8 +66,6 @@
|
|||
#define CODECS_DIR ROCKBOX_LIBRARY_PATH "/rockbox/codecs"
|
||||
#endif
|
||||
|
||||
extern void paths_init(void);
|
||||
|
||||
#endif /* !APPLICATION || SAMSUNG_YPR0 */
|
||||
|
||||
#define HOME_DIR_LEN (sizeof(HOME_DIR)-1)
|
||||
|
|
@ -91,6 +87,8 @@ int app_mkdir(const char* name);
|
|||
int app_rmdir(const char* name);
|
||||
ssize_t app_readlink(const char *path, char *buf, size_t bufsiz);
|
||||
|
||||
extern void paths_init(void);
|
||||
|
||||
#endif
|
||||
|
||||
#define REC_BASE_DIR HOME_DIR
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue