Skip to content

Commit

Permalink
Use utility function instead of locally declared function
Browse files Browse the repository at this point in the history
Issue: #4162
  • Loading branch information
buchen committed Aug 3, 2024
1 parent a129ad0 commit 092ca2d
Showing 1 changed file with 1 addition and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package name.abuchen.portfolio.ui.views.dataseries;

import static name.abuchen.portfolio.util.ArraysUtil.accumulateAndToDouble;
import static name.abuchen.portfolio.util.ArraysUtil.add;
import static name.abuchen.portfolio.util.ArraysUtil.toDouble;

import org.swtchart.IBarSeries;
Expand Down Expand Up @@ -116,16 +117,4 @@ private void addClient(DataSeries series, PerformanceIndex clientIndex)
configure(series, barSeries);
}
}

private long[] add(long[] a, long[] b)
{
if (a.length != b.length)
throw new IllegalArgumentException("length mismatch " + a.length + " != " + b.length); //$NON-NLS-1$ //$NON-NLS-2$

long[] result = new long[a.length];
for (int ii = 0; ii < result.length; ii++)
result[ii] = a[ii] + b[ii];

return result;
}
}

0 comments on commit 092ca2d

Please sign in to comment.