diff options
author | Thomas Martitz <kugel@rockbox.org> | 2014-02-24 23:07:37 +0100 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2014-02-24 23:07:37 +0100 |
commit | c27c3f10fd8c32e837c1f11176dc7223542bda6d (patch) | |
tree | 5c5cf1900071c8dac231409364f9948d4f6bc48f /firmware/export/rbpaths.h | |
parent | 3a3d26eee223f5d7307b9ab31d0dee93c82a41f5 (diff) | |
download | rockbox-c27c3f10fd8c32e837c1f11176dc7223542bda6d.tar.gz rockbox-c27c3f10fd8c32e837c1f11176dc7223542bda6d.zip |
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
Diffstat (limited to 'firmware/export/rbpaths.h')
-rw-r--r-- | firmware/export/rbpaths.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/firmware/export/rbpaths.h b/firmware/export/rbpaths.h index 1f7e1a2643..3600709482 100644 --- a/firmware/export/rbpaths.h +++ b/firmware/export/rbpaths.h | |||
@@ -55,8 +55,6 @@ | |||
55 | #define PLUGIN_DIR ROCKBOX_DIR "/rocks" | 55 | #define PLUGIN_DIR ROCKBOX_DIR "/rocks" |
56 | #define CODECS_DIR ROCKBOX_DIR "/codecs" | 56 | #define CODECS_DIR ROCKBOX_DIR "/codecs" |
57 | 57 | ||
58 | #define paths_init() | ||
59 | |||
60 | #else /* APPLICATION */ | 58 | #else /* APPLICATION */ |
61 | 59 | ||
62 | #define HOME_DIR "<HOME>" /* replaced at runtime */ | 60 | #define HOME_DIR "<HOME>" /* replaced at runtime */ |
@@ -68,8 +66,6 @@ | |||
68 | #define CODECS_DIR ROCKBOX_LIBRARY_PATH "/rockbox/codecs" | 66 | #define CODECS_DIR ROCKBOX_LIBRARY_PATH "/rockbox/codecs" |
69 | #endif | 67 | #endif |
70 | 68 | ||
71 | extern void paths_init(void); | ||
72 | |||
73 | #endif /* !APPLICATION || SAMSUNG_YPR0 */ | 69 | #endif /* !APPLICATION || SAMSUNG_YPR0 */ |
74 | 70 | ||
75 | #define HOME_DIR_LEN (sizeof(HOME_DIR)-1) | 71 | #define HOME_DIR_LEN (sizeof(HOME_DIR)-1) |
@@ -91,6 +87,8 @@ int app_mkdir(const char* name); | |||
91 | int app_rmdir(const char* name); | 87 | int app_rmdir(const char* name); |
92 | ssize_t app_readlink(const char *path, char *buf, size_t bufsiz); | 88 | ssize_t app_readlink(const char *path, char *buf, size_t bufsiz); |
93 | 89 | ||
90 | extern void paths_init(void); | ||
91 | |||
94 | #endif | 92 | #endif |
95 | 93 | ||
96 | #define REC_BASE_DIR HOME_DIR | 94 | #define REC_BASE_DIR HOME_DIR |