[PPL-devel] [GIT] ppl/ppl(master): Avoid abusing short-circuited logical operators ( prefer explicit control flow).

Enea Zaffanella zaffanella at cs.unipr.it
Fri Feb 17 11:21:04 CET 2012


Module: ppl/ppl
Branch: master
Commit: b861970ac6a1e593686b21df0619cc0f171d7a70
URL:    http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=b861970ac6a1e593686b21df0619cc0f171d7a70

Author: Enea Zaffanella <zaffanella at cs.unipr.it>
Date:   Fri Feb 17 11:04:37 2012 +0100

Avoid abusing short-circuited logical operators (prefer explicit control flow).
Detected by ECLAIR service utypflag.

---

 src/Grid_chdims.cc |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/Grid_chdims.cc b/src/Grid_chdims.cc
index 8349adc..092dad7 100644
--- a/src/Grid_chdims.cc
+++ b/src/Grid_chdims.cc
@@ -365,7 +365,8 @@ PPL::Grid::remove_higher_space_dimensions(const dimension_type new_dimension) {
     // Count the actual number of rows that are now redundant.
     dimension_type num_redundant = 0;
     for (dimension_type row = space_dim; row > new_dimension; --row)
-      dim_kinds[row] == CON_VIRTUAL || ++num_redundant;
+      if (dim_kinds[row] != CON_VIRTUAL)
+        ++num_redundant;
     if (num_redundant > 0) {
       dimension_type rows = con_sys.num_rows();
       // Shuffle the remaining rows upwards.




More information about the PPL-devel mailing list