mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
CmdCalc: Code cleanup
This commit is contained in:
parent
651c39c881
commit
d3a037231f
1 changed files with 3 additions and 5 deletions
|
@ -54,10 +54,8 @@ CmdCalc::CmdCalc ()
|
||||||
int CmdCalc::execute (std::string& output)
|
int CmdCalc::execute (std::string& output)
|
||||||
{
|
{
|
||||||
// Configurable infix/postfix
|
// Configurable infix/postfix
|
||||||
bool infix = true;
|
auto infix {true};
|
||||||
if (context.config.get ("expressions") == "infix")
|
if (context.config.get ("expressions") == "postfix")
|
||||||
infix = true;
|
|
||||||
else if (context.config.get ("expressions") == "postfix")
|
|
||||||
infix = false;
|
infix = false;
|
||||||
|
|
||||||
// Create an evaluator with DOM access.
|
// Create an evaluator with DOM access.
|
||||||
|
@ -68,7 +66,7 @@ int CmdCalc::execute (std::string& output)
|
||||||
|
|
||||||
// Compile all the args into one expression.
|
// Compile all the args into one expression.
|
||||||
std::string expression;
|
std::string expression;
|
||||||
for (auto& word : context.cli2.getWords ())
|
for (const auto& word : context.cli2.getWords ())
|
||||||
expression += word + ' ';
|
expression += word + ' ';
|
||||||
|
|
||||||
// Evaluate according to preference.
|
// Evaluate according to preference.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue