Skip to content

Commit

Permalink
Merge pull request dealii#16173 from bangerth/x5
Browse files Browse the repository at this point in the history
Move objects into place rather than swapping them.
  • Loading branch information
kronbichler authored Oct 24, 2023
2 parents ee37874 + ea6ca7e commit 9050964
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions source/fe/fe_system.cc
Original file line number Diff line number Diff line change
Expand Up @@ -963,8 +963,9 @@ FESystem<dim, spacedim>::get_restriction_matrix(
(*base_matrices[base])(base_index_i, base_index_j);
}

restriction.swap(const_cast<FullMatrix<double> &>(
this->restriction[refinement_case - 1][child]));
const_cast<FullMatrix<double> &>(
this->restriction[refinement_case - 1][child]) =
std::move(restriction);
}
}

Expand Down Expand Up @@ -1030,8 +1031,10 @@ FESystem<dim, spacedim>::get_prolongation_matrix(
prolongate(i, j) =
(*base_matrices[base])(base_index_i, base_index_j);
}
prolongate.swap(const_cast<FullMatrix<double> &>(
this->prolongation[refinement_case - 1][child]));

const_cast<FullMatrix<double> &>(
this->prolongation[refinement_case - 1][child]) =
std::move(prolongate);
}
}

Expand Down

0 comments on commit 9050964

Please sign in to comment.