mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 05:28:49 +00:00
Small tweaks to clarify some code
Adds a comment about a recursive lock, and changes an ==1 to >0 for improved clarity
This commit is contained in:
parent
73f344f41b
commit
84899fb2f8
1 changed files with 2 additions and 1 deletions
|
@ -92,7 +92,7 @@ static int load(const wcstring &name)
|
|||
bool was_autoload = is_autoload;
|
||||
int res;
|
||||
|
||||
bool no_more_autoload = function_tombstones.count(name) == 1;
|
||||
bool no_more_autoload = function_tombstones.count(name) > 0;
|
||||
if (no_more_autoload)
|
||||
return 0;
|
||||
|
||||
|
@ -239,6 +239,7 @@ int function_exists_no_autoload(const wcstring &cmd, const env_vars_snapshot_t &
|
|||
|
||||
static bool function_remove_ignore_autoload(const wcstring &name)
|
||||
{
|
||||
// Note: the lock may be held at this point, but is recursive
|
||||
scoped_lock lock(functions_lock);
|
||||
|
||||
function_map_t::iterator iter = loaded_functions.find(name);
|
||||
|
|
Loading…
Reference in a new issue