From ab049467b73ac2750b909478866fdca0e082d380 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Thu, 23 Jul 2015 17:52:22 +0200 Subject: [PATCH] First check, then assert. Also fix check syntax. --- src/core/partitiontable.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/partitiontable.cpp b/src/core/partitiontable.cpp index d725d8b..e73f414 100644 --- a/src/core/partitiontable.cpp +++ b/src/core/partitiontable.cpp @@ -256,7 +256,7 @@ Partition* createUnallocated(const Device& device, PartitionNode& parent, qint64 */ void PartitionTable::removeUnallocated(PartitionNode* p) { - Q_ASSERT(p != nullptr); + Q_ASSERT(p); qint32 i = 0; @@ -298,7 +298,7 @@ void PartitionTable::removeUnallocated() */ void PartitionTable::insertUnallocated(const Device& d, PartitionNode* p, qint64 start) const { - Q_ASSERT(p != nullptr); + Q_ASSERT(p); qint64 lastEnd = start; @@ -317,8 +317,8 @@ void PartitionTable::insertUnallocated(const Device& d, PartitionNode* p, qint64 if (!p->isRoot()) { Partition* extended = dynamic_cast(p); - Q_ASSERT(extended != nullptr); - parentEnd = (extended != nullptr) ? extended->lastSector() : -1; + parentEnd = extended ? extended->lastSector() : -1; + Q_ASSERT(extended); } if (parentEnd >= firstUsable())