[
https://issues.apache.org/jira/browse/MATH-1569?focusedWorklogId=819831&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-819831
]
ASF GitHub Bot logged work on MATH-1569:
----------------------------------------
Author: ASF GitHub Bot
Created on: 24/Oct/22 20:09
Start Date: 24/Oct/22 20:09
Worklog Time Spent: 10m
Work Description: aherbert commented on code in PR #219:
URL: https://github.com/apache/commons-math/pull/219#discussion_r1003705296
##########
commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/solvers/LaguerreSolver.java:
##########
@@ -274,9 +274,7 @@ public Complex[] solveAll(Complex[] coefficients, Complex
initial)
}
// Coefficients for deflated polynomial.
final Complex[] c = new Complex[n + 1];
- for (int i = 0; i <= n; i++) {
- c[i] = coefficients[i];
- }
+ System.arraycopy(coefficients, 0, c, 0, n + 1);
Review Comment:
I think this may be better as:
```Java
final Complex[] c = coefficients.clone();
```
##########
commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/fitting/leastsquares/LevenbergMarquardtOptimizer.java:
##########
@@ -738,9 +736,9 @@ private double determineLMParameter(double[] qy, double
delta, double[] diag,
// if the function is small enough, accept the current value
// of lmPar, also test for the exceptional cases where parl is zero
if (JdkMath.abs(fp) <= 0.1 * delta ||
- (parl == 0 &&
+ parl == 0 &&
Review Comment:
Now you have fixed the checkstyle suppressions file, you can revert the
changes to the parentheses
##########
commons-math-legacy-core/src/main/java/org/apache/commons/math4/legacy/core/dfp/Dfp.java:
##########
@@ -663,8 +663,8 @@ public Dfp getTwo() {
/** Shift the mantissa left, and adjust the exponent to compensate.
*/
protected void shiftLeft() {
- for (int i = mant.length - 1; i > 0; i--) {
- mant[i] = mant[i - 1];
+ if (mant.length - 1 >= 0) {
Review Comment:
This is still not updated to use ` > 0`
Issue Time Tracking
-------------------
Worklog Id: (was: 819831)
Time Spent: 3h (was: 2h 50m)
> Manual array copy
> -----------------
>
> Key: MATH-1569
> URL: https://issues.apache.org/jira/browse/MATH-1569
> Project: Commons Math
> Issue Type: Sub-task
> Reporter: Arturo Bernal
> Priority: Minor
> Time Spent: 3h
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)