Skip to content

Commit

Permalink
small-code-quality-improvements Made small code quality improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRealHaui authored and Michael Hausegger committed Sep 20, 2017
1 parent b553e21 commit ff0124f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1304,6 +1304,6 @@ private static boolean equals(double x, double y) {
* @return the hash code
*/
private static int hash(double value) {
return new Double(value).hashCode();
return Double.valueOf(value).hashCode();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ public static float[] extractInterleavedFloatFromComplexArray(Complex[] complex,
*/
public static Complex[] real2Complex(double[] real) {
int index = 0;
final Complex c[] = new Complex[real.length];
final Complex[] c = new Complex[real.length];
for (double d : real) {
c[index] = new Complex(d);
index++;
Expand All @@ -311,7 +311,7 @@ public static Complex[] real2Complex(double[] real) {
*/
public static Complex[] real2Complex(float[] real) {
int index = 0;
final Complex c[] = new Complex[real.length];
final Complex[] c = new Complex[real.length];
for (float d : real) {
c[index] = new Complex(d);
index++;
Expand Down Expand Up @@ -366,7 +366,7 @@ public static Complex[][][] real2Complex(double[][][] d) {
*/
public static double[] complex2Real(Complex[] c) {
int index = 0;
final double d[] = new double[c.length];
final double[] d = new double[c.length];
for (Complex cc : c) {
d[index] = cc.getReal();
index++;
Expand All @@ -385,7 +385,7 @@ public static double[] complex2Real(Complex[] c) {
*/
public static float[] complex2RealFloat(Complex[] c) {
int index = 0;
final float f[] = new float[c.length];
final float[] f = new float[c.length];
for (Complex cc : c) {
f[index] = (float) cc.getReal();
index++;
Expand Down Expand Up @@ -473,7 +473,7 @@ public static float[][][] complex2RealFloat(Complex[][][] c) {
*/
public static Complex[] imaginary2Complex(double[] imaginary) {
int index = 0;
final Complex c[] = new Complex[imaginary.length];
final Complex[] c = new Complex[imaginary.length];
for (double d : imaginary) {
c[index] = new Complex(0, d);
index++;
Expand All @@ -491,7 +491,7 @@ public static Complex[] imaginary2Complex(double[] imaginary) {
*/
public static Complex[] imaginary2Complex(float[] imaginary) {
int index = 0;
final Complex c[] = new Complex[imaginary.length];
final Complex[] c = new Complex[imaginary.length];
for (float d : imaginary) {
c[index] = new Complex(0, d);
index++;
Expand Down Expand Up @@ -551,7 +551,7 @@ public static Complex[][][] imaginary2Complex(double[][][] d) {
*/
public static double[] complex2Imaginary(Complex[] c) {
int index = 0;
final double d[] = new double[c.length];
final double[] d = new double[c.length];
for (Complex cc : c) {
d[index] = cc.getImaginary();
index++;
Expand All @@ -570,7 +570,7 @@ public static double[] complex2Imaginary(Complex[] c) {
*/
public static float[] complex2ImaginaryFloat(Complex[] c) {
int index = 0;
final float f[] = new float[c.length];
final float[] f = new float[c.length];
for (Complex cc : c) {
f[index] = (float) cc.getImaginary();
index++;
Expand Down Expand Up @@ -660,7 +660,7 @@ public static float[][][] complex2ImaginaryFloat(Complex[][][] c) {
*/
public static Complex[] interleaved2Complex(double[] interleaved) {
final int length = interleaved.length / 2;
final Complex c[] = new Complex[length];
final Complex[] c = new Complex[length];
for (int n = 0; n < length; n++) {
c[n] = new Complex(interleaved[n * 2], interleaved[n * 2 + 1]);
}
Expand All @@ -678,7 +678,7 @@ public static Complex[] interleaved2Complex(double[] interleaved) {
*/
public static Complex[] interleaved2Complex(float[] interleaved) {
final int length = interleaved.length / 2;
final Complex c[] = new Complex[length];
final Complex[] c = new Complex[length];
for (int n = 0; n < length; n++) {
c[n] = new Complex(interleaved[n * 2], interleaved[n * 2 + 1]);
}
Expand All @@ -697,7 +697,7 @@ public static Complex[] interleaved2Complex(float[] interleaved) {
*/
public static double[] complex2Interleaved(Complex[] c) {
int index = 0;
final double d[] = new double[c.length * 2];
final double[] d = new double[c.length * 2];
for (Complex cc : c) {
int real = index * 2;
int imag = index * 2 + 1;
Expand All @@ -720,7 +720,7 @@ public static double[] complex2Interleaved(Complex[] c) {
*/
public static float[] complex2InterleavedFloat(Complex[] c) {
int index = 0;
final float f[] = new float[c.length * 2];
final float[] f = new float[c.length * 2];
for (Complex cc : c) {
int real = index * 2;
int imag = index * 2 + 1;
Expand Down

0 comments on commit ff0124f

Please sign in to comment.