diff options
Diffstat (limited to 'src/nodes.cc')
-rw-r--r-- | src/nodes.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/nodes.cc b/src/nodes.cc index e75c02b..f15a8c9 100644 --- a/src/nodes.cc +++ b/src/nodes.cc @@ -49,12 +49,11 @@ double OperatorNode::solve() { ); } case TokenType::OPERATOR_DIVIDE: { - double rightChild = this->rightChild->solve(); + const double rightChild{ this->rightChild->solve() }; if ( rightChild != 0 ) { return this->leftChild->solve() / rightChild; - } - else { + } else { throw divide_exception(); } } |