From b765b57739463d0aa3b833a70e0ea87bca68e82e Mon Sep 17 00:00:00 2001 From: Adrian Kummerländer Date: Mon, 29 Jul 2013 21:07:40 +0200 Subject: Coding style improvements --- src/tree.cc | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'src/tree.cc') diff --git a/src/tree.cc b/src/tree.cc index 0fa41ad..5c47a50 100644 --- a/src/tree.cc +++ b/src/tree.cc @@ -15,7 +15,9 @@ double Tree::solve() { } Node* Tree::addOperand(Node** place, double value) { - this->node_collection_.emplace_back(new OperandNode(value)); + this->node_collection_.emplace_back( + new OperandNode(value) + ); if ( place != nullptr ) { *place = this->node_collection_.back().get(); @@ -25,7 +27,9 @@ Node* Tree::addOperand(Node** place, double value) { } Node* Tree::addOperator(Node** place, char oper) { - this->node_collection_.emplace_back(new OperatorNode(oper)); + this->node_collection_.emplace_back( + new OperatorNode(oper) + ); if ( place != nullptr ) { *place = this->node_collection_.back().get(); @@ -47,7 +51,9 @@ std::string Tree::print(std::string term) { int i = 0; - for ( auto it = this->node_collection_.begin(); it != this->node_collection_.end(); ++it ) { + for ( auto it = this->node_collection_.begin(); + it != this->node_collection_.end(); + ++it ) { out << "node" << i << " [ label = \"" @@ -56,7 +62,9 @@ std::string Tree::print(std::string term) { << std::endl; if ( (*it)->getType() == OPERATOR_NODE ) { - for ( auto iter = this->node_collection_.begin(); iter != this->node_collection_.end(); ++iter ) { + for ( auto iter = this->node_collection_.begin(); + iter != this->node_collection_.end(); + ++iter ) { if ( (*iter).get() == (*it)->leftChild ) { out << "\"node" << i @@ -84,4 +92,4 @@ std::string Tree::print(std::string term) { return out.str(); } -} // SimpleParser +} -- cgit v1.2.3