Skip to content

Commit acc1520

Browse files
committed
root_dir: no need for pattern
1 parent 2694232 commit acc1520

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

+stdlib/root_dir.m

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,13 @@
1313
p string
1414
end
1515

16-
sep = characterListPattern("/" + filesep);
17-
1816
r = repmat("", size(p));
1917

20-
i = startsWith(p, sep);
18+
i = startsWith(p, ["/", filesep]);
2119
r(i) = extractBefore(p(i), 2);
2220

2321
if ispc()
24-
i = startsWith(p, lettersPattern(1) + ":" + sep);
22+
i = startsWith(p, lettersPattern(1) + ":" + characterListPattern("/" + filesep));
2523
r(i) = extractBetween(p(i), 3, 3);
2624
end
2725

0 commit comments

Comments
 (0)