]> https://gitweb.dealii.org/ - dealii.git/commitdiff
assertions checking if pointers are null are moved inside loop
authornivesh <nidhinivesh.d@gmail.com>
Mon, 2 Apr 2018 12:02:25 +0000 (14:02 +0200)
committernivesh <nidhinivesh.d@gmail.com>
Mon, 2 Apr 2018 12:02:25 +0000 (14:02 +0200)
source/lac/sparsity_tools.cc

index e26b02aea4f3399fcaffa8bd43f0c31b40f6a4c7..299e95ccec2a948725408ceab8d3b43f5dc8cbeb 100644 (file)
@@ -203,9 +203,6 @@ namespace SparsityTools
       ZOLTAN_ID_PTR nextNborGID = nborGID;
       int *nextNborProc = nborProc;
 
-      Assert( nextNborGID != nullptr , ExcInternalError() );
-      Assert( nextNborProc != nullptr , ExcInternalError() );
-
       //Loop through rows corresponding to indices in globalID implicitly
       for (SparsityPattern::size_type i=0; i < static_cast<SparsityPattern::size_type>(num_obj); ++i)
         {
@@ -215,6 +212,9 @@ namespace SparsityTools
             //Ignore diagonal entries. Not needed for partitioning.
             if ( i != col->column() )
               {
+                Assert( nextNborGID != nullptr , ExcInternalError() );
+                Assert( nextNborProc != nullptr , ExcInternalError() );
+
                 *nextNborGID++ = col->column();
                 *nextNborProc++ = 0;    //All the vertices on processor 0
               }

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.