Skip to content

Commit

Permalink
[#74] Unused locals, double conditionals
Browse files Browse the repository at this point in the history
- Deleted code, debugged code
  • Loading branch information
iperdomo committed May 18, 2023
1 parent 16809e8 commit f49b852
Showing 1 changed file with 0 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,29 +191,23 @@ public static Object podArrayFromString(String array, String splitRegex, Class<?
long[] lret = new long[pods.length];
float[] fret = new float[pods.length];
boolean[] bret = new boolean[pods.length];
int nd = 0, ni = 0;
int cl = 0;
for (int i = 0; i < pods.length; i++) {
if (pods[i] instanceof Double) {
cl = 1;
dret[i] = (Double) pods[i];
nd++;
} else if (pods[i] instanceof Integer) {
cl = 2;
iret[i] = (Integer) pods[i];
ni++;
} else if (pods[i] instanceof Long) {
cl = 3;
lret[i] = (Long) pods[i];
ni++;
} else if (pods[i] instanceof Float) {
cl = 4;
fret[i] = (Float) pods[i];
ni++;
} else if (pods[i] instanceof Boolean) {
cl = 5;
bret[i] = (Boolean) pods[i];
ni++;
}
}

Expand Down Expand Up @@ -274,32 +268,6 @@ public static double[] normalize(double[] vals) {
return ret;
}

public static double sumWithoutNan(double[] data) {
double ret = 0;
for (double v : data) {
if (!Double.isNaN(v)) {
if (!Double.isNaN(v)) {
ret += v;
}
}
}
return ret;
}

public static double averageWithoutNan(double[] data) {
int n = 0;
double ret = 0;
for (double v : data) {
if (!Double.isNaN(v)) {
if (!Double.isNaN(v)) {
ret += v;
n++;
}
}
}
return ret / (double) n;
}

public static Number convertNumber(Number object, Class<?> cls) {
if (Double.class.isAssignableFrom(cls)) {
return object.doubleValue();
Expand Down

0 comments on commit f49b852

Please sign in to comment.