From ccd8368c9971e3105a7fa92f6e468e5528528399 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christoph=20Gr=C3=BCninger?= <gruenich@dune-project.org>
Date: Sun, 9 Jun 2024 08:54:20 +0200
Subject: [PATCH] solverfactorytest: range-based for loops with const
 references

This is less about performance and mor about silencing
the Clazy warnings.
Found by Clazy (range-loop-reference)
---
 dune/istl/test/solverfactorytest.cc.in | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/dune/istl/test/solverfactorytest.cc.in b/dune/istl/test/solverfactorytest.cc.in
index 39ecf3cda..c5a519ff7 100644
--- a/dune/istl/test/solverfactorytest.cc.in
+++ b/dune/istl/test/solverfactorytest.cc.in
@@ -60,7 +60,7 @@ void testSeq(const Dune::ParameterTree& config, Comm c){
     using Operator = Dune::MatrixAdapter<Matrix, Vector, Vector>;
     std::shared_ptr<Operator> op = std::make_shared<Operator>(mat);
 
-    for(std::string test : config.getSubKeys()){
+    for(const std::string& test : config.getSubKeys()){
       Dune::ParameterTree solverConfig = config.sub(test);
       std::cout << " ============== " << test << " ============== " << std::endl;
       try{
@@ -96,7 +96,7 @@ void testOverlapping(const Dune::ParameterTree& config, Comm c){
 
   std::shared_ptr<Operator> op = std::make_shared<Operator>(mat, comm);
 
-  for(std::string test : config.getSubKeys()){
+  for(const std::string& test : config.getSubKeys()){
     Dune::ParameterTree solverConfig = config.sub(test);
     std::cout << " ============== " << test << " ============== " << std::endl;
     try{
@@ -131,7 +131,7 @@ void testNonoverlapping(const Dune::ParameterTree& config, Comm c){
 
   std::shared_ptr<Operator> op = std::make_shared<Operator>(mat, comm);
 
-  for(std::string test : config.getSubKeys()){
+  for(const std::string& test : config.getSubKeys()){
     Dune::ParameterTree solverConfig = config.sub(test);
     std::cout << " ============== " << test << " ============== " << std::endl;
     try{
-- 
GitLab