diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2015-04-06 08:38:18 -0700 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2015-04-06 08:38:31 -0700 |
commit | 84899fb2f8c7a2a869ee16b028af45308145820c (patch) | |
tree | f80fe98a62aec789335dfed7aa2ef954ebff5af1 /function.cpp | |
parent | 73f344f41bd20c005a0f5b810dc20229392f2bf8 (diff) |
Small tweaks to clarify some code
Adds a comment about a recursive lock, and changes an ==1 to >0
for improved clarity
Diffstat (limited to 'function.cpp')
-rw-r--r-- | function.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/function.cpp b/function.cpp index adb16479..5d113c24 100644 --- a/function.cpp +++ b/function.cpp @@ -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); |