permute: remove one of test which checks if x is empty (following: 47/18947/2
Adeline CARNIS [Tue, 24 Jan 2017 16:26:28 +0000 (17:26 +0100)]
https://codereview.scilab.org/#/c/18933/)

Change-Id: Ia7d2a318db097ca77863cb425609142c5d77b990

scilab/modules/elementary_functions/macros/permute.sci

index aaf37ab..6d470df 100644 (file)
@@ -30,8 +30,9 @@ function y = permute(x, dims)
         error(msprintf(msg, "permute", 2));
     end
 
-    if x==[] then
-        y = []
+    // Case x is empty
+    if isempty(x) then
+        y = x
         return
     end
 
@@ -42,12 +43,6 @@ function y = permute(x, dims)
         error(msprintf(msg, "permute", 2, ndims(x)-1));
     end
 
-    // Case x is empty
-    if isempty(x) then
-        y = x
-        return
-    end
-
     // ---------------- PROCESSING --------------------
     // Existing indices
     s = size(x)