Skip to content
Snippets Groups Projects
Commit 1755ecf9 authored by Christoph Grüninger's avatar Christoph Grüninger
Browse files

Simplify conditions to not test "== true" or "== false"

Use the left-hand side as a condition
parent 610d2ee9
No related branches found
No related tags found
1 merge request!569Fix some issues found by Clazy, Cppcheck, and myself
Pipeline #71504 passed
......@@ -132,7 +132,7 @@ namespace Dune {
// at the beginning make a multimap "bordercontribution".
// process has i and j as border dofs but is not the owner
// => only contribute to Ax if i,j is in bordercontribution
if (buildcomm == true) {
if (buildcomm) {
// set up mask vector
if (mask.size()!=static_cast<typename std::vector<double>::size_type>(x.size())) {
......@@ -188,7 +188,7 @@ namespace Dune {
flag = false;
continue;
}
if (flag == false)
if (!flag)
continue;
}
// don´t contribute to Ax if
......@@ -198,7 +198,7 @@ namespace Dune {
// as interor/border dofs
// if the owner of j does not have i as interior/border dof,
// it will not be taken into account
if (flag==true)
if (flag)
bordercontribution.insert(std::pair<int,int>(i.index(),j.index()));
}
}
......
......@@ -656,17 +656,17 @@ namespace Dune {
if (OwnerCopyToOwnerCopyInterfaceBuilt) OwnerCopyToOwnerCopyInterface.free();
if (CopyToAllInterfaceBuilt) CopyToAllInterface.free();
if (globalLookup_) delete globalLookup_;
if (freecomm==true)
if(comm!=MPI_COMM_NULL)
{
// If it is possible to query whether MPI_Finalize
// was called, only free the communicator before
// calling MPI_Finalize.
int wasFinalized = 0;
MPI_Finalized( &wasFinalized );
if(!wasFinalized)
MPI_Comm_free(&comm);
if (freecomm && (comm != MPI_COMM_NULL))
{
// If it is possible to query whether MPI_Finalize
// was called, only free the communicator before
// calling MPI_Finalize.
int wasFinalized = 0;
MPI_Finalized(&wasFinalized);
if (!wasFinalized) {
MPI_Comm_free(&comm);
}
}
}
private:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment