Mercurial > hg > octave-max
changeset 10099:29959c705df2
avoid assignment in condition of if statement
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 13 Jan 2010 20:45:31 -0500 |
parents | d3451c1496f8 |
children | dd4d4b14b340 |
files | src/ChangeLog src/oct-obj.cc |
diffstat | 2 files changed, 9 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-01-13 John W. Eaton <jwe@octave.org> + + * oct-obj.cc (octave_value_list::any_cell): Avoid assignment in + condition of if statement. + 2010-01-13 John W. Eaton <jwe@octave.org> * DLD-FUNCTIONS/lu.cc: Avoid test failures if HAVE_QRUPDATE_LUU is
--- 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