]> https://gitweb.dealii.org/ - dealii.git/commit
Improve loop nesting.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 6 Nov 2015 22:13:43 +0000 (16:13 -0600)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Sat, 7 Nov 2015 21:01:42 +0000 (15:01 -0600)
commitd501b1864a5377d488c1f3bdd385ef471337d8e5
tree19ffcf634e4ab173f6f5a6d441e1d6caaa5861f0
parentd29934d84413b763221ee5ae7ca44c43b7508ef5
Improve loop nesting.

We had a number of places of the form
  for (...tight loop...)
    if (constant condition)
      data update;

The compiler almost certainly can hoist the condition out of the loop,
but why make it this complicated for the compiler. I also find the code
easier to read because the loop is really only over a counting index
and does not carry any particular meaning at a level higher than the
if-statement.
include/deal.II/fe/fe_poly.templates.h
include/deal.II/fe/fe_poly_face.templates.h
source/fe/fe_dgp_nonparametric.cc

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.