[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

@@ -50,7 +50,9 @@ public class NoiseFunction2 implements NoiseFunction {
double zz = z >= 0 ? z * 2 : z * -2 - 1;
double key = (xx >= zz) ? (xx * xx + xx + zz) : (zz * zz + xx);
double value = this.get(key);
if (this.size() > cacheSize) { this.clear(); }
if(this.size() > cacheSize) {
this.clear();
}
return (value == 4.9E-324D ? addAndReturn(noise.getNoise(x, z), key) : value);
}