From 4c538f6575724106c7e194fa0a5a150651d2732d Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Sun, 24 Jun 2018 23:58:17 +0200 Subject: [PATCH] Fix some clang-tidy findings --- examples/step-18/step-18.cc | 2 +- examples/step-36/step-36.cc | 2 +- examples/step-8/step-8.cc | 2 +- include/deal.II/matrix_free/matrix_free.h | 3 +-- source/dofs/dof_tools_constraints.cc | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/examples/step-18/step-18.cc b/examples/step-18/step-18.cc index a6767ffd61..176f46b8c1 100644 --- a/examples/step-18/step-18.cc +++ b/examples/step-18/step-18.cc @@ -962,7 +962,7 @@ namespace Step18 // As in step-17, we only need to loop over all cells that belong to the // present processor: - for (const auto cell : dof_handler.active_cell_iterators()) + for (const auto &cell : dof_handler.active_cell_iterators()) if (cell->is_locally_owned()) { cell_matrix = 0; diff --git a/examples/step-36/step-36.cc b/examples/step-36/step-36.cc index 5951d7fd28..d44c112908 100644 --- a/examples/step-36/step-36.cc +++ b/examples/step-36/step-36.cc @@ -258,7 +258,7 @@ namespace Step36 typename FunctionParser::ConstMap()); std::vector potential_values(n_q_points); - for (const auto cell : dof_handler.active_cell_iterators()) + for (const auto &cell : dof_handler.active_cell_iterators()) { fe_values.reinit(cell); cell_stiffness_matrix = 0; diff --git a/examples/step-8/step-8.cc b/examples/step-8/step-8.cc index 971c778b74..4927b72858 100644 --- a/examples/step-8/step-8.cc +++ b/examples/step-8/step-8.cc @@ -304,7 +304,7 @@ namespace Step8 std::vector> rhs_values(n_q_points); // Now we can begin with the loop over all cells: - for (const auto cell : dof_handler.active_cell_iterators()) + for (const auto &cell : dof_handler.active_cell_iterators()) { cell_matrix = 0; cell_rhs = 0; diff --git a/include/deal.II/matrix_free/matrix_free.h b/include/deal.II/matrix_free/matrix_free.h index dd86631b39..33aa2c3bd5 100644 --- a/include/deal.II/matrix_free/matrix_free.h +++ b/include/deal.II/matrix_free/matrix_free.h @@ -45,8 +45,7 @@ #include #include -#include - +#include #include #include #include diff --git a/source/dofs/dof_tools_constraints.cc b/source/dofs/dof_tools_constraints.cc index 99d70c5a1e..0c2bfbd9e3 100644 --- a/source/dofs/dof_tools_constraints.cc +++ b/source/dofs/dof_tools_constraints.cc @@ -1080,7 +1080,7 @@ namespace DoFTools // note that even though we may visit a face twice if the neighboring // cells are equally refined, we can only visit each face with hanging // nodes once - for (const auto cell : dof_handler.active_cell_iterators()) + for (const auto &cell : dof_handler.active_cell_iterators()) { // artificial cells can at best neighbor ghost cells, but we're not // interested in these interfaces -- 2.39.5