From ea8ae68e6f1a686fd96530fdaf7b428e33f58ec4 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 4 Jan 2009 19:08:52 +0100 Subject: directory: added directory_is_root() directory_is_root() is cheaper than isRootDirectory(directory_get_path()). --- src/directory.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/directory.h') diff --git a/src/directory.h b/src/directory.h index afe81faad..36f0deb18 100644 --- a/src/directory.h +++ b/src/directory.h @@ -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. */ -- cgit v1.2.3