# HG changeset patch # User Jaroslav Hajek # Date 1280948118 -7200 # Node ID 6c57bd7d0808171ac392723438b05fe607f29044 # Parent f1a45913662ac716016605bb7e84a573cccdf5c1 isargout optimization in sortrows diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2010-08-04 Jaroslav Hajek + + * general/sortrows.m: Don't actually permute the rows if not + requested. + 2010-08-01 Rik * deprecated/intwarning.m, general/arrayfun.m, general/cplxpair.m, diff --git a/scripts/general/sortrows.m b/scripts/general/sortrows.m --- a/scripts/general/sortrows.m +++ b/scripts/general/sortrows.m @@ -53,7 +53,10 @@ i = sort_rows_idx_generic (default_mode, other_mode, m, c); endif - s = m(i,:); + ## Only bother to compute s if needed. + if (isargout (1)) + s = m(i,:); + endif endfunction