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.
This commit is contained in:
Max Kellermann
2008-10-08 11:06:44 +02:00
parent e1a4474ad4
commit ba5c9b0375
2 changed files with 10 additions and 6 deletions

View File

@@ -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);