From 10b6da04521cf3f65f3c47bece8e2e5e6e664d6d Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Mon, 5 Feb 2024 13:54:01 -0500 Subject: mtab: Take the basename directly in bfs_might_be_mount() This avoids some hot xbaseoff() calls. --- src/mtab.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/mtab.c') diff --git a/src/mtab.c b/src/mtab.c index cc726a2..c76f403 100644 --- a/src/mtab.c +++ b/src/mtab.c @@ -271,8 +271,7 @@ const char *bfs_fstype(const struct bfs_mtab *mtab, const struct bfs_stat *statb } } -bool bfs_might_be_mount(const struct bfs_mtab *mtab, const char *path) { - const char *name = path + xbaseoff(path); +bool bfs_might_be_mount(const struct bfs_mtab *mtab, const char *name) { return trie_find_str(&mtab->names, name); } -- cgit v1.2.3