diff options
author | Max Kellermann <max@duempel.org> | 2008-10-08 11:06:44 +0200 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-10-11 19:21:48 -0700 |
commit | f8e2879c37b9ee5953e71456ba777363f7dc30fc (patch) | |
tree | 756f2eb8597e267b805e90aad8d685e495476507 /src/directory.h | |
parent | 81bdc3f625ecce1eca87009caf89e98abd405f51 (diff) | |
download | mpd-f8e2879c37b9ee5953e71456ba777363f7dc30fc.tar.gz mpd-f8e2879c37b9ee5953e71456ba777363f7dc30fc.tar.xz mpd-f8e2879c37b9ee5953e71456ba777363f7dc30fc.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 72de511e7..127da678c 100644 --- a/src/directory.h +++ b/src/directory.h @@ -41,7 +41,11 @@ void directory_init(void); void directory_finish(void); -int isRootDirectory(const char *name); +static inline int isRootDirectory(const char *name) +{ + /* TODO: verify and remove !name check */ + return (!name || *name == '\0' || !strcmp(name, "/")); +} struct directory * directory_get_root(void); |