mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
lint: Use early exit/continue
This commit is contained in:
parent
feaeca4999
commit
50fc3d72df
1 changed files with 41 additions and 43 deletions
|
@ -238,9 +238,11 @@ bool autoload_t::locate_file_and_maybe_load_it(const wcstring &cmd, bool really_
|
|||
wcstring path = next + L"/" + cmd + L".fish";
|
||||
|
||||
const file_access_attempt_t access = access_file(path, R_OK);
|
||||
if (access.accessible) {
|
||||
found_file = true;
|
||||
if (!access.accessible) {
|
||||
continue;
|
||||
}
|
||||
|
||||
found_file = true;
|
||||
// Now we're actually going to take the lock.
|
||||
scoped_lock locker(lock);
|
||||
autoload_function_t *func = this->get_node(cmd);
|
||||
|
@ -269,9 +271,7 @@ bool autoload_t::locate_file_and_maybe_load_it(const wcstring &cmd, bool really_
|
|||
// Create the function if we haven't yet. This does not load it. Do not trigger
|
||||
// eviction unless we are actually loading, because we don't want to evict off of
|
||||
// the main thread.
|
||||
if (!func) {
|
||||
func = get_autoloaded_function_with_creation(cmd, really_load);
|
||||
}
|
||||
if (!func) func = get_autoloaded_function_with_creation(cmd, really_load);
|
||||
|
||||
// It's a fiction to say the script is loaded at this point, but we're definitely
|
||||
// going to load it down below.
|
||||
|
@ -279,10 +279,8 @@ bool autoload_t::locate_file_and_maybe_load_it(const wcstring &cmd, bool really_
|
|||
|
||||
// Unconditionally record our access time.
|
||||
func->access = access;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// If no file or builtin script was found we insert a placeholder function. Later we only
|
||||
// research if the current time is at least five seconds later. This way, the files won't be
|
||||
|
|
Loading…
Reference in a new issue