diff options
author | Max Kellermann <max@duempel.org> | 2008-10-08 11:06:44 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-10-08 11:06:44 +0200 |
commit | ba5c9b0375b84456553b9b57cb68cb204c1d9418 (patch) | |
tree | 459d20c7a4e0f078110c6007940ff2a8593fd10a /src/directory.h | |
parent | e1a4474ad4a0bc78ac338223b0528e0161f38e98 (diff) | |
download | mpd-ba5c9b0375b84456553b9b57cb68cb204c1d9418.tar.gz mpd-ba5c9b0375b84456553b9b57cb68cb204c1d9418.tar.xz mpd-ba5c9b0375b84456553b9b57cb68cb204c1d9418.zip |
directory: converted isRootDirectory() to an inline function
The function isRootDirectory() is tiny and can be converted to an
inline function. Don't allow name==NULL.
Diffstat (limited to 'src/directory.h')
-rw-r--r-- | src/directory.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/directory.h b/src/directory.h index c1ff1828b..554b77513 100644 --- a/src/directory.h +++ b/src/directory.h @@ -46,7 +46,11 @@ void directory_init(void); void directory_finish(void); -int isRootDirectory(const char *name); +static inline bool +isRootDirectory(const char *name) +{ + return name[0] == 0 || (name[0] == '/' && name[1] == 0); +} struct directory * directory_get_root(void); |