From: nivesh Date: Mon, 2 Apr 2018 12:02:25 +0000 (+0200) Subject: assertions checking if pointers are null are moved inside loop X-Git-Tag: v9.0.0-rc1~247^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4cd7ffb38ece1af2397f059a66e74c8013d89da2;p=dealii.git assertions checking if pointers are null are moved inside loop --- diff --git a/source/lac/sparsity_tools.cc b/source/lac/sparsity_tools.cc index e26b02aea4..299e95ccec 100644 --- a/source/lac/sparsity_tools.cc +++ b/source/lac/sparsity_tools.cc @@ -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(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 }