From 148e8d5d1b3932ab44c6a7664f1e6780ca0605ea Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 1 May 2019 13:44:15 -0600 Subject: [PATCH] Rename a local variable, make one 'const'. --- source/grid/grid_tools.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/source/grid/grid_tools.cc b/source/grid/grid_tools.cc index 228c4badb0..6a181319e3 100644 --- a/source/grid/grid_tools.cc +++ b/source/grid/grid_tools.cc @@ -1364,27 +1364,27 @@ namespace GridTools // If marked_indices is empty, consider all used_vertices for finding the // closest vertex to the point. Otherwise, marked_indices is used. - const std::vector &used = (marked_vertices.size() == 0) ? - tria.get_used_vertices() : - marked_vertices; + const std::vector &vertices_to_use = (marked_vertices.size() == 0) ? + tria.get_used_vertices() : + marked_vertices; // At the beginning, the first used vertex is considered to be the closest // one. std::vector::const_iterator first = - std::find(used.begin(), used.end(), true); + std::find(vertices_to_use.begin(), vertices_to_use.end(), true); // Assert that at least one vertex is actually used - Assert(first != used.end(), ExcInternalError()); + Assert(first != vertices_to_use.end(), ExcInternalError()); - unsigned int best_vertex = std::distance(used.begin(), first); + unsigned int best_vertex = std::distance(vertices_to_use.begin(), first); double best_dist = (p - vertices[best_vertex]).norm_square(); // For all remaining vertices, test // whether they are any closer for (unsigned int j = best_vertex + 1; j < vertices.size(); j++) - if (used[j]) + if (vertices_to_use[j]) { - double dist = (p - vertices[j]).norm_square(); + const double dist = (p - vertices[j]).norm_square(); if (dist < best_dist) { best_vertex = j; -- 2.39.5