Skip to content
Snippets Groups Projects
Verified Commit 50b0568a authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

@dseries/hptrend_, @dseries/mpower: remove duplicate branches in if/then/else statement

Detected by MATLAB Code Analyzer app.
parent c8901abc
No related branches found
No related tags found
No related merge requests found
......@@ -37,18 +37,10 @@ end
o.data = sample_hp_filter(o.data, lambda);
for i=1:vobs(o)
if isempty(o.ops{i})
if isempty(lambda)
o.ops(i) = {sprintf('hptrend(%s, [])', o.name{i})};
else
o.ops(i) = {sprintf('hptrend(%s, %s)', o.name{i}, num2str(lambda))};
end
if isempty(lambda)
o.ops(i) = {sprintf('hptrend(%s, [])', o.name{i})};
else
if isempty(lambda)
o.ops(i) = {sprintf('hptrend(%s, [])', o.name{i})};
else
o.ops(i) = {sprintf('hptrend(%s, %s)', o.name{i}, num2str(lambda))};
end
o.ops(i) = {sprintf('hptrend(%s, %s)', o.name{i}, num2str(lambda))};
end
end
......
......@@ -39,11 +39,7 @@ if isnumeric(p) && isvector(p) && isdseries(o) && length(p)==nobs(o)
q = copy(o);
q.data = bsxfun(@power, o.data, p);
for i=1:vobs(q)
if isempty(q.ops{i})
q.ops(i) = {sprintf('power(%s, %s)', q.name{i}, matrix2string(p))};
else
q.ops(i) = {sprintf('power(%s, %s)', q.name{i}, matrix2string(p))};
end
q.ops(i) = {sprintf('power(%s, %s)', q.name{i}, matrix2string(p))};
end
return
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment