From a583e3b4edfd4c6dedf9a513eea88d6bb2f7c422 Mon Sep 17 00:00:00 2001
From: Oliver Sander <oliver.sander@tu-dresden.de>
Date: Tue, 29 Dec 2015 12:06:52 +0100
Subject: [PATCH] [cleanup] Replace hand-written loop by std::copy

---
 dune/istl/bcrsmatrix.hh | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/dune/istl/bcrsmatrix.hh b/dune/istl/bcrsmatrix.hh
index a7c97ac36..159a7e5e7 100644
--- a/dune/istl/bcrsmatrix.hh
+++ b/dune/istl/bcrsmatrix.hh
@@ -976,10 +976,7 @@ namespace Dune {
           Mat.r[i].set(0,nullptr,nullptr);
 
         // initialize the j array for row i from pattern
-        size_type k=0;
-        size_type *j =  Mat.r[i].getindexptr();
-        for (typename PatternType::const_iterator it=pattern.begin(); it!=pattern.end(); ++it)
-          j[k++] = *it;
+        std::copy(pattern.cbegin(), pattern.cend(), Mat.r[i].getindexptr());
 
         // now go to next row
         i++;
-- 
GitLab