]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Bugfix: Implement BlockIndices::swap correctly
authorMatthias Maier <tamiko@43-1.org>
Mon, 4 May 2015 10:37:05 +0000 (12:37 +0200)
committerMatthias Maier <tamiko@43-1.org>
Mon, 4 May 2015 11:53:23 +0000 (13:53 +0200)
include/deal.II/lac/block_indices.h

index 97defa2a1bc434f437c4e84f26d2b86172c3c582..6713fb44f7baba6a09d26e3ac3f8fe33d29ee5d1 100644 (file)
@@ -463,11 +463,8 @@ inline
 void
 BlockIndices::swap (BlockIndices &b)
 {
-  Assert (n_blocks == b.n_blocks,
-          ExcDimensionMismatch(n_blocks, b.n_blocks));
-
-  for (size_type i=0; i<=n_blocks; ++i)
-    std::swap (start_indices[i], b.start_indices[i]);
+  std::swap(n_blocks, b.n_blocks);
+  std::swap(start_indices, b.start_indices);
 }
 
 

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.