Mercurial > hg > octave-terminal
changeset 10651:944b78191f03
simplify octave_base_value::rows and columns
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Tue, 25 May 2010 07:41:31 +0200 |
parents | f0dc41c824ce |
children | 2f0fbfa4dd23 |
files | src/ChangeLog src/ov-base.h |
diffstat | 2 files changed, 9 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-05-25 Jaroslav Hajek <highegg@gmail.com> + + * ov-base.h (octave_base_value::rows, octave_base_value::columns): + Use const where appropriate, don't test for impossible condition. + 2010-05-24 Jaroslav Hajek <highegg@gmail.com> * Cell.h (Cell::index, Cell::assign, Cell::delete_elements):
--- a/src/ov-base.h +++ b/src/ov-base.h @@ -277,16 +277,16 @@ octave_idx_type rows (void) const { - dim_vector dv = dims (); + const dim_vector dv = dims (); - return (dv.length () > 0) ? dv(0) : -1; + return dv(0); } octave_idx_type columns (void) const { - dim_vector dv = dims (); + const dim_vector dv = dims (); - return (dv.length () > 1) ? dv(1) : -1; + return dv(1); } virtual int ndims (void) const;