Mercurial > hg > octave-lojdl
changeset 10002:e93c9bfff8b8
allow size_equal with 0 arguments
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Sat, 19 Dec 2009 21:10:46 +0100 |
parents | 6918d86add73 |
children | 2ea3110e15ed |
files | ChangeLog src/data.cc |
diffstat | 2 files changed, 7 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-12-19 Jaroslav Hajek <highegg@gmail.com> + + * data.cc (Fsize_equal): Allow calling with zero arguments. + 2009-12-15 John W. Eaton <jwe@octave.org> * README.MSVC: Delete section about obtaining glob library.
--- a/src/data.cc +++ b/src/data.cc @@ -2545,7 +2545,7 @@ @deftypefn {Built-in Function} {} size_equal (@var{a}, @var{b}, @dots{})\n\ Return true if the dimensions of all arguments agree.\n\ Trailing singleton dimensions are ignored.\n\ -Called with a single argument, size_equal returns true.\n\ +Called with a single or no argument, size_equal returns true.\n\ @seealso{size, numel}\n\ @end deftypefn") { @@ -2553,10 +2553,10 @@ int nargin = args.length (); + retval = true; + if (nargin >= 1) { - retval = true; - dim_vector a_dims = args(0).dims (); for (int i = 1; i < nargin; ++i) @@ -2570,8 +2570,6 @@ } } } - else - print_usage (); return retval; }