Skip to content

Commit

Permalink
#9 TI-1: Merge if statements
Browse files Browse the repository at this point in the history
  • Loading branch information
lauft committed Jul 18, 2018
1 parent af621a3 commit 21b4b62
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/commands/CmdConfig.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -293,9 +293,13 @@ int CmdConfig (
return CmdShow (rules); return CmdShow (rules);
} }


// Join the remaining words into config variable's value bool change = false;

// timew config name value
// timew config name ""
if (words.size () > 1) if (words.size () > 1)
{ {
// Join the remaining words into config variable's value
for (unsigned int i = 1; i < words.size (); ++i) for (unsigned int i = 1; i < words.size (); ++i)
{ {
if (i > 1) if (i > 1)
Expand All @@ -305,15 +309,9 @@ int CmdConfig (


value += words[i]; value += words[i];
} }
}

bool change = false;


// timew config name value
// timew config name ""
if (words.size () > 1)
{
change = setConfigVariable (database, rules, name, value, confirmation); change = setConfigVariable (database, rules, name, value, confirmation);

if (!change) if (!change)
{ {
rc = 1; rc = 1;
Expand Down

0 comments on commit 21b4b62

Please sign in to comment.