directory: added directory_is_root()
directory_is_root() is cheaper than isRootDirectory(directory_get_path()).
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user