From f053853e87624a045438bacd4dd1494e91ae381f Mon Sep 17 00:00:00 2001 From: Renaud G Date: Fri, 27 Oct 2017 22:19:20 +0200 Subject: -c++11 update about for and nullptr. --- node/sortresult.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'node/sortresult.cpp') diff --git a/node/sortresult.cpp b/node/sortresult.cpp index d864aa2..e3d8d1e 100644 --- a/node/sortresult.cpp +++ b/node/sortresult.cpp @@ -34,13 +34,13 @@ SortResultNode::SortResultNode() void SortResultNode::run(ExecutionNode* node) { m_previousNode = node; - if(NULL==node) + if(nullptr==node) { return; } DiceResult* previousDiceResult = dynamic_cast(node->getResult()); m_diceResult->setPrevious(previousDiceResult); - if(NULL!=previousDiceResult) + if(nullptr!=previousDiceResult) { QList diceList=previousDiceResult->getResultList(); QList diceList2=m_diceResult->getResultList(); @@ -57,7 +57,7 @@ void SortResultNode::run(ExecutionNode* node) bool found = false; int start = 0; int end = diceList2.size(); - Die* tmp2 = NULL; + Die* tmp2 = nullptr; while(!found) { int distance = end-start; @@ -92,7 +92,7 @@ void SortResultNode::run(ExecutionNode* node) } m_diceResult->setResultList(diceList2); - if(NULL!=m_nextNode) + if(nullptr!=m_nextNode) { m_nextNode->run(this); } @@ -123,22 +123,19 @@ QString SortResultNode::toString(bool wl) const qint64 SortResultNode::getPriority() const { qint64 priority=0; - if(NULL!=m_nextNode) + if(nullptr != m_previousNode) { - priority = m_nextNode->getPriority(); + priority = m_previousNode->getPriority(); } - - return priority; } ExecutionNode* SortResultNode::getCopy() const { SortResultNode* node = new SortResultNode(); node->setSortAscending(m_ascending); - if(NULL!=m_nextNode) + if(nullptr!=m_nextNode) { node->setNextNode(m_nextNode->getCopy()); } return node; - } -- cgit v1.2.3-70-g09d2