Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[pvs-studio] Simplify boolean expressions.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 19 Jul 2021 13:06:25 +0000 (15:06 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 19 Jul 2021 13:06:38 +0000 (15:06 +0200)
src/kernel/lmm/maxmin.cpp
src/mc/compare.cpp
src/smpi/mpi/smpi_request.cpp

index 4f34717..1586f5e 100644 (file)
@@ -939,7 +939,7 @@ int Constraint::get_variable_amount() const
 
 void Constraint::set_sharing_policy(SharingPolicy policy, const s4u::NonLinearResourceCb& cb)
 {
-  xbt_assert(!cb || (cb && policy == SharingPolicy::NONLINEAR),
+  xbt_assert(policy == SharingPolicy::NONLINEAR || not cb,
              "Invalid sharing policy for constraint. Callback should be used with NONLINEAR sharing policy");
   sharing_policy_    = policy;
   dyn_constraint_cb_ = cb;
index ce9121e..f2a09f4 100644 (file)
@@ -880,7 +880,7 @@ static bool heap_area_differ(const RemoteProcess& process, StateComparator& stat
     }
 
     // Check if the blocks are already matched together:
-    if (state.equals_to_<1>(block1, frag1).valid_ && state.equals_to_<2>(block2, frag2).valid_ && offset1 == offset2 &&
+    if (state.equals_to_<1>(block1, frag1).valid_ && state.equals_to_<2>(block2, frag2).valid_ &&
         state.fragmentsEqual(block1, frag1, block2, frag2)) {
       if (match_pairs)
         state.match_equals(previous);
index d6abc90..880763c 100644 (file)
@@ -1070,7 +1070,7 @@ int Request::waitany(int count, MPI_Request requests[], MPI_Status * status)
           // This is a finished detached request, let's return this one
           comms.clear(); // don't do the waitany call afterwards
           index = i;
-          if (requests[index] != MPI_REQUEST_NULL && (requests[index])->flags_ & MPI_REQ_NBC)
+          if (requests[index]->flags_ & MPI_REQ_NBC)
             finish_nbc_requests(&requests[index], 0);
           finish_wait(&requests[i], status); // cleanup if refcount = 0
           if (requests[i] != MPI_REQUEST_NULL && (requests[i]->flags_ & MPI_REQ_NON_PERSISTENT))