]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Rename a local variable, make one 'const'.
authorWolfgang Bangerth <bangerth@colostate.edu>
Wed, 1 May 2019 19:44:15 +0000 (13:44 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 2 May 2019 15:19:27 +0000 (09:19 -0600)
source/grid/grid_tools.cc

index 228c4badb0a5bd2bb9984dd37079351aa0e68ae0..6a181319e3bc223fa5a02131954aabeba4914f45 100644 (file)
@@ -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<bool> &used = (marked_vertices.size() == 0) ?
-                                      tria.get_used_vertices() :
-                                      marked_vertices;
+    const std::vector<bool> &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<bool>::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;

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.