diff scripts/general/shift.m @ 12674:9493880928c8

Use common idiom in m-files for finding first non-singleton dimension. * flipdim.m, postpad.m, prepad.m, shift.m, unwrap.m: Use common idiom in m-files for finding first non-singleton dimension.
author Rik <octave@nomad.inbox5.com>
date Sun, 15 May 2011 08:58:49 -0700
parents c792872f8942
children 2783fa95cab7
line wrap: on
line diff
--- a/scripts/general/shift.m
+++ b/scripts/general/shift.m
@@ -51,10 +51,7 @@
     endif
   else
     ## Find the first non-singleton dimension.
-    dim = find (sz > 1, 1);
-    if (isempty (dim))
-      dim = 1;
-    endif
+    (dim = find (sz > 1, 1)) || (dim = 1);
   endif
 
   if (numel (x) < 1)