# HG changeset patch # User Rik # Date 1451145488 28800 # Node ID 8b8d8c6c0e64e81c36d828039b8a05a44e89a242 # Parent f99cbd86a0f9ef694967f9705fdbc878c63ffe68 Add new member function is_empty to Range type. Use it. * Range.h (is_empty): New function. * ov-range.cc (is_true): Use is_empty rather than "numel () == 0". diff -r f99cbd86a0f9 -r 8b8d8c6c0e64 libinterp/octave-value/ov-range.cc --- a/libinterp/octave-value/ov-range.cc Sat Dec 26 08:49:41 2015 +0100 +++ b/libinterp/octave-value/ov-range.cc Sat Dec 26 07:58:08 2015 -0800 @@ -273,7 +273,7 @@ { bool retval = false; - if (! range.numel () != 0) + if (! range.is_empty ()) { // FIXME: this is a potential waste of memory. diff -r f99cbd86a0f9 -r 8b8d8c6c0e64 liboctave/array/Range.h --- a/liboctave/array/Range.h Sat Dec 26 08:49:41 2015 +0100 +++ b/liboctave/array/Range.h Sat Dec 26 07:58:08 2015 -0800 @@ -100,6 +100,7 @@ double inc (void) const { return rng_inc; } GCC_ATTR_DEPRECATED octave_idx_type nelem (void) const { return numel (); } octave_idx_type numel (void) const { return rng_numel; } + bool is_empty (void) const { return numel () == 0; } bool all_elements_are_ints (void) const;