Skip to content

Commit 7d52ed1

Browse files
committed
vectorize
1 parent 289b06c commit 7d52ed1

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

+stdlib/expanduser.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
end
1616

1717

18-
pat = ['~[/\', filesep(), ']+|^~$'];
18+
pat = ['~[/\', filesep, ']+|^~$'];
1919

2020
[i0, i1] = regexp(p, pat, 'once');
2121

@@ -30,9 +30,9 @@
3030
if i1 - i0 == 0 || strlength(p) == i1
3131
e = home;
3232
elseif isstring(p)
33-
e = strjoin([home, extractAfter(p, i1)], filesep());
33+
e = strjoin([home, extractAfter(p, i1)], filesep);
3434
else
35-
e = strjoin({home, p(i1:end)}, filesep());
35+
e = strjoin({home, p(i1:end)}, filesep);
3636
end
3737

3838
if isstring(p)

+stdlib/filename.m

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,7 @@
66
% filename (including suffix) without directory
77

88
function f = filename(p)
9-
arguments
10-
p {mustBeTextScalar}
11-
end
129

13-
f = extractAfter(p, asManyOfPattern(wildcardPattern + ("/" | filesep())));
10+
f = extractAfter(p, asManyOfPattern(wildcardPattern + ("/" | filesep)));
1411

1512
end
16-
17-
18-
%!assert (filename('a/b/c.txt'), 'c.txt')
19-
%!assert (filename('a/b/'), '')

+stdlib/root_dir.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
p {mustBeTextScalar}
1414
end
1515

16-
sep = characterListPattern("/" + filesep());
16+
sep = characterListPattern("/" + filesep);
1717
pat = (textBoundary + sep);
1818
if ispc()
1919
pat = pat | (lookBehindBoundary(lettersPattern(1) + ":") + sep);

0 commit comments

Comments
 (0)