]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Bugfix: Remove an unnecessary second pass for value initialization
authorMatthias Maier <tamiko@43-1.org>
Mon, 7 Sep 2015 16:02:34 +0000 (11:02 -0500)
committerMatthias Maier <tamiko@43-1.org>
Mon, 7 Sep 2015 18:36:24 +0000 (13:36 -0500)
include/deal.II/base/tensor.h

index 7a52daf46f59a419b6e313544abf878919d27cf6..41414649bc8dfbd20af3a556668144437d9c70d8 100644 (file)
@@ -822,11 +822,13 @@ namespace internal
 
 template <int rank_, int dim, typename Number>
 inline
-Tensor<rank_,dim,Number>::Tensor (const bool initialize)
+Tensor<rank_,dim,Number>::Tensor (const bool /*initialize*/)
 {
-  if (initialize)
-    for (unsigned int i=0; i!=dim; ++i)
-      values[i] = value_type();
+  // All members of the c-style array values are already default initialized
+  // and thus all values are already set to zero recursively.
+
+  // TODO: Think about using the default heap allocator to restore the old
+  // behavior.
 }
 
 

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.