# HG changeset patch # User John W. Eaton # Date 1263433531 18000 # Node ID 29959c705df2a6d65f7945beaf246d6d1931b6fd # Parent d3451c1496f846fad0f520cabba0bd0bb2f29bdf avoid assignment in condition of if statement diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-01-13 John W. Eaton + + * oct-obj.cc (octave_value_list::any_cell): Avoid assignment in + condition of if statement. + 2010-01-13 John W. Eaton * DLD-FUNCTIONS/lu.cc: Avoid test failures if HAVE_QRUPDATE_LUU is diff --git a/src/oct-obj.cc b/src/oct-obj.cc --- a/src/oct-obj.cc +++ b/src/oct-obj.cc @@ -190,14 +190,13 @@ bool octave_value_list::any_cell (void) const { - bool retval = false; octave_idx_type n = length (); for (octave_idx_type i = 0; i < n; i++) - if (retval = elem (i).is_cell ()) - break; - - return retval; + if (elem (i).is_cell ()) + return true; + + return false; } bool