First round of fixes based on cppcheck

https://github.com/fish-shell/fish-shell/issues/575
This commit is contained in:
ridiculousfish
2013-02-16 00:02:40 -08:00
parent 635c87d629
commit 6d522e6ed6
10 changed files with 49 additions and 64 deletions

View File

@@ -1171,7 +1171,7 @@ static void functions_def(const wcstring &name, wcstring &out)
wcstring_list_t named = function_get_named_arguments(name);
if (named.size() > 0)
if (! named.empty())
{
append_format(out, L" --argument");
for (size_t i=0; i < named.size(); i++)
@@ -3531,7 +3531,7 @@ static int builtin_end(parser_t &parser, wchar_t **argv)
const wcstring val = for_vars.back();
for_vars.pop_back();
const wcstring &for_variable = fb->variable;
env_set(for_variable.c_str(), val.c_str(), ENV_LOCAL);
env_set(for_variable, val.c_str(), ENV_LOCAL);
parser.current_block->loop_status = LOOP_NORMAL;
parser.current_block->skip = 0;