Skip to content

Commit b5784b1

Browse files
committed
simplify
1 parent b51d163 commit b5784b1

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

+stdlib/+fileio/which.m

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,16 @@
1919
end
2020
end
2121

22-
%% directory/filename given
23-
for name = names
22+
% directory/filename given
23+
for exe = names
2424

25-
if strlength(fileparts(name)) > 0
26-
% has directory part
27-
if stdlib.fileio.is_exe(name)
28-
exe = name;
29-
return
30-
end
25+
if strlength(fileparts(exe)) > 0 && stdlib.fileio.is_exe(exe)
26+
return
3127
end
3228

3329
end % for name
3430

35-
%% path given
31+
% path given
3632

3733
if isscalar(fpath)
3834
fpath = split(stdlib.fileio.expanduser(fpath), pathsep).';

0 commit comments

Comments
 (0)