Remove bin.is_file() because it's expensive (#1689)

This one change takes the startup time from 2.8 seconds to 1.2 seconds in my testing on Windows.
This commit is contained in:
Darren Schroeder 2020-04-30 13:43:59 -05:00 committed by GitHub
parent 7d403a6cc7
commit e9e3fac59d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -136,10 +136,6 @@ pub fn load_plugins(context: &mut Context) -> Result<(), ShellError> {
Err(_) => {}
Ok(binaries) => {
for bin in binaries.filter_map(Result::ok) {
if !bin.is_file() {
continue;
}
let bin_name = {
if let Some(name) = bin.file_name() {
match name.to_str() {