Bravely remove a call to wrealpath in globbing

When globbing, we have a base directory (typically $PWD) and a path
component relative to that. As PWD is "virtual" it may be a symlink. Prior
to this change we would use wrealpath to resolve symlinks before opening
the directory during a glob, but this call to wrealpath consumed roughly
half of the time during globbing, and is conceptually unnecessary as
opendir will resolve symlinks for us.

Remove it. This may have funny effects if the user's PWD is an unlinked
directory, but it roughly doubles the speed of a glob like `echo ~/**`.
This commit is contained in:
ridiculousfish 2020-12-05 13:48:56 -08:00
parent 8a29fa6778
commit 91503151c9

View File

@ -695,11 +695,6 @@ class wildcard_expander_t {
// cd operates on logical paths.
// for example, cd ../<tab> should complete "without resolving symlinks".
path = normalize_path(path);
} else {
// Other commands operate on physical paths.
if (auto tmp = wrealpath(path)) {
path = tmp.acquire();
}
}
return wopendir(path);
}