Skip to content

Commit e2fc714

Browse files
committed
parent: improve efficiency
1 parent 96848fb commit e2fc714

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

+stdlib/+native/parent.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
i = stdlib.strempty(p);
1515
p(i) = ".";
1616

17-
i = ispc() & strcmp(p(~i), stdlib.root_name(pth(~i)));
18-
p(i) = strcat(p(i), filesep);
17+
if ispc()
18+
i = strcmp(p(~i), stdlib.root_name(pth(~i)));
19+
p(i) = strcat(p(i), filesep);
20+
end
1921

2022
end

private/get_compiler.m

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
case "fortran"
1515
comp = getenv("FC");
1616
if isempty(comp)
17-
disp("set FC environment variable to the Fortran compiler path via get_compiler('fortran'), or do 'mex -setup c++")
17+
disp("set FC environment variable to the Fortran compiler path via get_compiler('fortran'), or do 'mex -setup Fortran")
1818
end
1919
case "c++"
2020
comp = getenv("CXX");
@@ -49,5 +49,3 @@
4949
end
5050

5151
end
52-
53-

test/TestParent.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function test_parent(tc, p, backend)
1818
try
1919
pr = stdlib.parent(p{1}, backend);
2020
catch e
21-
tc.verifyEqual(e.identifier, 'stdlib:hbackend:NameError', e.message)
21+
tc.verifyEqual(e.identifier, 'stdlib:hbackend:NameError', e.stack(1).file + ":" + string(e.stack(1).line) + " " + e.message)
2222
return
2323
end
2424
tc.verifyEqual(pr, p{2}, sprintf("parent(%s, %s)", p{1}, backend))

0 commit comments

Comments
 (0)