Mercurial > octave
changeset 24799:74a596fd6bab
Fix unused variable warning in Range elem(i,j) function introduced in 0d21e2a1cdfc.
* Range.h (elem (octave_idx_type i, octave_idx_type j)): Move simple one-line
function from Range.cc to header file so that it can be inlined by compiler.
Only declare type of first unused input to establish function signature, but
don't use a name to avoid unused variable warning.
* Range.cc (elem (octave_idx_type i, octave_idx_type j)): Deleted function.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 26 Feb 2018 17:35:21 -0800 |
parents | 45470049a43f |
children | 2dc04b6e1740 |
files | liboctave/array/Range.cc liboctave/array/Range.h |
diffstat | 2 files changed, 2 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/array/Range.cc Fri Feb 23 14:33:55 2018 +0100 +++ b/liboctave/array/Range.cc Mon Feb 26 17:35:21 2018 -0800 @@ -105,12 +105,6 @@ return rng_limit; } -double -Range::elem (octave_idx_type i, octave_idx_type j) const -{ - return elem (j); -} - // Helper class used solely for idx_vector.loop () function call class __rangeidx_helper {
--- a/liboctave/array/Range.h Fri Feb 23 14:33:55 2018 +0100 +++ b/liboctave/array/Range.h Mon Feb 26 17:35:21 2018 -0800 @@ -124,7 +124,8 @@ double checkelem (octave_idx_type i, octave_idx_type j) const; double elem (octave_idx_type i) const; - double elem (octave_idx_type i, octave_idx_type j) const; + double elem (octave_idx_type /* i */, octave_idx_type j) const + { return elem (j); } double operator () (octave_idx_type i) const { return elem (i); } double operator () (octave_idx_type i, octave_idx_type j) const