From d0382d1e01646c6bc634ed08fe1c9aa009470432 Mon Sep 17 00:00:00 2001 From: Renaud G Date: Sat, 30 Jan 2016 16:53:38 +0100 Subject: Cppcheck warning for ifnode. --- diceparser.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'diceparser.cpp') diff --git a/diceparser.cpp b/diceparser.cpp index ebd163d..8d96d5a 100644 --- a/diceparser.cpp +++ b/diceparser.cpp @@ -977,23 +977,25 @@ bool DiceParser::readIfInstruction(QString& str,ExecutionNode*& trueNode,Executi { str=str.remove(0,1); ExecutionNode* node; - bool hasExpresion = readExpression(str,node); - if(str.startsWith('}')) + if(readExpression(str,node)) { - trueNode = node; - str=str.remove(0,1); - if(str.startsWith('{')) + if(str.startsWith('}')) { + trueNode = node; str=str.remove(0,1); - ExecutionNode* node2; - readExpression(str,node2); - if(str.startsWith('}')) + if(str.startsWith('{')) { - falseNode=node2; - return true; + str=str.remove(0,1); + ExecutionNode* node2; + readExpression(str,node2); + if(str.startsWith('}')) + { + falseNode=node2; + return true; + } } + return true; } - return true; } } return false; -- cgit v1.2.3-70-g09d2