changeset 10850:6c57bd7d0808

isargout optimization in sortrows
author Jaroslav Hajek <highegg@gmail.com>
date Wed, 04 Aug 2010 20:55:18 +0200
parents f1a45913662a
children 5b33a5777ab0
files scripts/ChangeLog scripts/general/sortrows.m
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog
+++ b/scripts/ChangeLog
@@ -1,3 +1,8 @@
+2010-08-04  Jaroslav Hajek  <highegg@gmail.com>
+
+	* general/sortrows.m: Don't actually permute the rows if not
+	requested.
+
 2010-08-01  Rik <octave@nomad.inbox5.com>
 
 	* deprecated/intwarning.m, general/arrayfun.m, general/cplxpair.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