[GIT] ppl/ppl(master): Make comparison against zero explicit.

Module: ppl/ppl Branch: master Commit: eb1e922ffe18c27b7b544781b745102730d8c2c4 URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=eb1e922ffe18c...
Author: Enea Zaffanella zaffanella@cs.unipr.it Date: Wed Feb 15 17:38:51 2012 +0100
Make comparison against zero explicit. Detected by ECLAIR service utypflag. While at it, simplified control flow by removing a use of `continue'.
---
src/Congruence_System.cc | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/Congruence_System.cc b/src/Congruence_System.cc index 0cdb287..1c53eb2 100644 --- a/src/Congruence_System.cc +++ b/src/Congruence_System.cc @@ -503,10 +503,9 @@ PPL::operator==(const Congruence_System& x, const Congruence_System& y) { if (x.num_columns() == y.num_columns()) { dimension_type num_rows = x.num_rows(); if (num_rows == y.num_rows()) { - while (num_rows--) { - if (x[num_rows] == y[num_rows]) - continue; - return false; + while (num_rows-- > 0) { + if (x[num_rows] != y[num_rows]) + return false; } return true; }
participants (1)
-
Enea Zaffanella