Skip to content

Commit deaa13c

Browse files
committed
backend: only check if not specified
1 parent db827a9 commit deaa13c

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

+stdlib/Backend.m

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
classdef Backend < matlab.mixin.SetGet
22

33
properties (Constant)
4-
optionalBackends = ["perl", "python", "dotnet", "java"]
4+
optionalBackends = ["java", "perl", "python", "dotnet"]
55
namespace = "stdlib"
66
end
77

@@ -19,16 +19,19 @@
1919
backendReq (1,:) string = string.empty
2020
end
2121

22-
for i = 1:numel(self.optionalBackends)
23-
f = str2func(sprintf('%s.has_%s', self.namespace, self.optionalBackends(i)));
24-
if f()
25-
self.backends = [self.optionalBackends(i), self.backends];
22+
if isempty(backendReq) || ~isscalar(backendReq)
23+
for i = 1:numel(self.optionalBackends)
24+
f = str2func(sprintf('%s.has_%s', self.namespace, self.optionalBackends(i)));
25+
if f()
26+
self.backends = [self.optionalBackends(i), self.backends];
27+
end
2628
end
2729
end
2830

2931
if strlength(functionName)
3032
self.func = self.getFunc(functionName, backendReq);
3133
end
34+
3235
end
3336

3437

0 commit comments

Comments
 (0)