summaryrefslogtreecommitdiff
path: root/src/expr.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/expr.cc')
-rw-r--r--src/expr.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/expr.cc b/src/expr.cc
index 2e069f0..8500d13 100644
--- a/src/expr.cc
+++ b/src/expr.cc
@@ -105,8 +105,7 @@ Value Expression::evaluate(const Context *context) const
if (this->type == ">")
return this->children[0]->evaluate(context) > this->children[1]->evaluate(context);
if (this->type == "?:") {
- Value v = this->children[0]->evaluate(context);
- return this->children[v.toBool() ? 1 : 2]->evaluate(context);
+ return this->children[this->children[0]->evaluate(context) ? 1 : 2]->evaluate(context);
}
if (this->type == "[]") {
return this->children[0]->evaluate(context)[this->children[1]->evaluate(context)];
contact: Jan Huwald // Impressum