aboutsummaryrefslogtreecommitdiffhomepage
path: root/function.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2015-04-06 08:38:18 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2015-04-06 08:38:31 -0700
commit84899fb2f8c7a2a869ee16b028af45308145820c (patch)
treef80fe98a62aec789335dfed7aa2ef954ebff5af1 /function.cpp
parent73f344f41bd20c005a0f5b810dc20229392f2bf8 (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.cpp3
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);