# HG changeset patch # User Jaroslav Hajek # Date 1261253446 -3600 # Node ID e93c9bfff8b891913e3b99e3210e2bc995d4cbc7 # Parent 6918d86add73884b6318937bbe955e6b6364d392 allow size_equal with 0 arguments diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-12-19 Jaroslav Hajek + + * data.cc (Fsize_equal): Allow calling with zero arguments. + 2009-12-15 John W. Eaton * README.MSVC: Delete section about obtaining glob library. diff --git a/src/data.cc b/src/data.cc --- 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; }