Skip to content

Commit 5ae7042

Browse files
committed
is_exe: exists check for speed
1 parent 4d63444 commit 5ae7042

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

+stdlib/is_exe.m

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
use_java (1,1) logical = false
1010
end
1111

12+
ok = false;
13+
if ~stdlib.exists(file, use_java), return, end
1214

1315
if use_java
1416
% about the same time as fileattrib
@@ -20,11 +22,6 @@
2022

2123
else
2224

23-
if ~stdlib.len(p)
24-
ok = false;
25-
return
26-
end
27-
2825
[status, v] = fileattrib(p);
2926

3027
ok = status ~= 0 && (v.UserExecute || (~isnan(v.GroupExecute) && v.GroupExecute) || (~isnan(v.OtherExecute) && v.OtherExecute));

0 commit comments

Comments
 (0)