]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid a warning. 2472/head
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 6 Apr 2016 21:07:49 +0000 (16:07 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 6 Apr 2016 21:10:30 +0000 (16:10 -0500)
This fixes a warning introduced in #2449. There, @drwells had asked me
why I wrote
        for (std::size_t i=0; i!=N; ++i)
when I could have written
        for (std::size_t i=0; i<N; ++i)
I didn't remember and changed it to the latter, which did not warn on
my laptop but does now on the compute server. The reason is that N is
of type std::size_t, which turns out to be unsigned, and so warns if
we happen to have N==0. This patch fixes the issue.

include/deal.II/base/memory_consumption.h

index d59a50fd81630b1f3424bdbfa3ef47d0b111f845..64b3a4e74fb145a34e14f90ab2d19bf047a79ba9 100644 (file)
@@ -352,7 +352,7 @@ namespace MemoryConsumption
     else
       {
         std::size_t mem = 0;
-        for (std::size_t i=0; i<N; ++i)
+        for (std::size_t i=0; i!=N; ++i)
           mem += memory_consumption(v[i]);
         return mem;
       }

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.