[AUTO] Cleanup code

This commit is contained in:
dfsek
2020-11-23 23:02:36 -07:00
parent 65c2ad6b7a
commit f309bd8809
6 changed files with 85 additions and 83 deletions

View File

@@ -62,7 +62,7 @@ class DistributionTest {
int end = normalMap.length - 1;
while(start + 1 < end) {
int mid = start + (end - start) / 2;
if (normalMap[mid] <= d) {
if(normalMap[mid] <= d) {
start = mid;
} else {
end = mid;
@@ -70,7 +70,7 @@ class DistributionTest {
}
double left = FastMath.abs(normalMap[start] - d);
double right = FastMath.abs(normalMap[end] - d);
if (left <= right) {
if(left <= right) {
return start * (num) / (normalMap.length);
}
return end * (num) / (normalMap.length);

View File

@@ -95,7 +95,7 @@ class LookupGenerator {
public static int normalizeNew(double d) {
for(int i = 0; i < lookup.length; i++) {
if (d < lookup[i]) return i;
if(d < lookup[i]) return i;
}
return lookup.length - 1;
}