mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
String garbage reduction
This commit is contained in:
parent
f57ad5a888
commit
2e3bf585ea
@ -366,7 +366,7 @@ public class IrisData implements ExclusionStrategy, TypeAdapterFactory {
|
|||||||
if(f.getPath().startsWith(getDataFolder().getPath())) {
|
if(f.getPath().startsWith(getDataFolder().getPath())) {
|
||||||
String[] full = f.getPath().split("\\Q" + File.separator + "\\E");
|
String[] full = f.getPath().split("\\Q" + File.separator + "\\E");
|
||||||
String[] df = getDataFolder().getPath().split("\\Q" + File.separator + "\\E");
|
String[] df = getDataFolder().getPath().split("\\Q" + File.separator + "\\E");
|
||||||
String g = "";
|
StringBuilder g = new StringBuilder();
|
||||||
boolean m = true;
|
boolean m = true;
|
||||||
for(int i = 0; i < full.length; i++) {
|
for(int i = 0; i < full.length; i++) {
|
||||||
if(i >= df.length) {
|
if(i >= df.length) {
|
||||||
@ -375,7 +375,7 @@ public class IrisData implements ExclusionStrategy, TypeAdapterFactory {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
g += "/" + full[i];
|
g.append("/").append(full[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -337,10 +337,10 @@ public class IrisInterpolation {
|
|||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
if(array) {
|
if(array) {
|
||||||
fb.append("private static final double[] F" + (int) checks + "A = {");
|
fb.append("private static final double[] F").append((int) checks).append("A = {");
|
||||||
}
|
}
|
||||||
|
|
||||||
sb.append("private static double sc" + (int) checks + "(int x, int z, double r, NoiseProvider n) {\n return (");
|
sb.append("private static double sc").append((int) checks).append("(int x, int z, double r, NoiseProvider n) {\n return (");
|
||||||
for(int i = 0; i < 360; i += m) {
|
for(int i = 0; i < 360; i += m) {
|
||||||
double sin = Math.sin(Math.toRadians(i));
|
double sin = Math.sin(Math.toRadians(i));
|
||||||
double cos = Math.cos(Math.toRadians(i));
|
double cos = Math.cos(Math.toRadians(i));
|
||||||
@ -350,13 +350,13 @@ public class IrisInterpolation {
|
|||||||
String ss = array ? "F" + (int) checks + "A[" + (igx++) + "]" : "F" + (int) checks + "S" + ig;
|
String ss = array ? "F" + (int) checks + "A[" + (igx++) + "]" : "F" + (int) checks + "S" + ig;
|
||||||
|
|
||||||
if(array) {
|
if(array) {
|
||||||
fb.append((ig > 0 ? (ig % 6 == 0 ? ",\n" : ",") : "") + cof + "," + sif);
|
fb.append(ig > 0 ? (ig % 6 == 0 ? ",\n" : ",") : "").append(cof).append(",").append(sif);
|
||||||
} else {
|
} else {
|
||||||
fb.append("private static final double " + cc + " = " + cof + ";\n");
|
fb.append("private static final double ").append(cc).append(" = ").append(cof).append(";\n");
|
||||||
fb.append("private static final double " + ss + " = " + sif + ";\n");
|
fb.append("private static final double ").append(ss).append(" = ").append(sif).append(";\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
sb.append((ig > 0 ? "\n +" : "") + "n.noise(x + ((r * " + cc + ") - (r * " + ss + ")), z + ((r * " + ss + ") + (r * " + cc + ")))");
|
sb.append(ig > 0 ? "\n +" : "").append("n.noise(x + ((r * ").append(cc).append(") - (r * ").append(ss).append(")), z + ((r * ").append(ss).append(") + (r * ").append(cc).append(")))");
|
||||||
ig++;
|
ig++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -364,7 +364,7 @@ public class IrisInterpolation {
|
|||||||
fb.append("};");
|
fb.append("};");
|
||||||
}
|
}
|
||||||
|
|
||||||
sb.append(")/" + checks + "D;\n}");
|
sb.append(")/").append(checks).append("D;\n}");
|
||||||
return fb + "\n" + sb;
|
return fb + "\n" + sb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@ import java.io.IOException;
|
|||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.URLConnection;
|
import java.net.URLConnection;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
public abstract class DL {
|
public abstract class DL {
|
||||||
protected File d;
|
protected File d;
|
||||||
@ -65,9 +66,7 @@ public abstract class DL {
|
|||||||
flags = new KSet<>();
|
flags = new KSet<>();
|
||||||
latch = new ChronoLatch(500);
|
latch = new ChronoLatch(500);
|
||||||
|
|
||||||
for(DownloadFlag i : downloadFlags) {
|
flags.addAll(Arrays.asList(downloadFlags));
|
||||||
flags.add(i);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void monitor(DownloadMonitor m) {
|
public void monitor(DownloadMonitor m) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user