directory: added directory_is_root()

directory_is_root() is cheaper than
isRootDirectory(directory_get_path()).
This commit is contained in:
Max Kellermann
2009-01-04 19:08:52 +01:00
parent 923d2c966f
commit ea8ae68e6f
6 changed files with 18 additions and 8 deletions

View File

@@ -70,6 +70,15 @@ directory_get_path(const struct directory *directory)
return directory->path;
}
/**
* Is this the root directory of the music database?
*/
static inline bool
directory_is_root(const struct directory *directory)
{
return directory->parent == NULL;
}
/**
* Returns the base name of the directory.
*/