Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticdrew committed Mar 9, 2024
1 parent 07f0e59 commit 755f77a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,7 @@ protected Float[][] populateSlopes(final ChunkMD chunkMd, Integer vSlice,
Float[][] slopes = chunkSlopes.getUnchecked(chunkMd.getCoordLong());
int y = 0, sliceMinY = 0, sliceMaxY = 0;
boolean isSurface = (vSlice == null);
Float slope, primarySlope, secondarySlope;
BlockMD blockMD;
float slope, primarySlope, secondarySlope;

if (!isSurface)
{
Expand Down Expand Up @@ -258,7 +257,7 @@ else if (secondarySlope < primarySlope)
}

// Set that slope. Set it good. Aw yeah.
if (slope.isNaN())
if (Float.isNaN(slope))
{
slope = 1f;
}
Expand Down Expand Up @@ -337,8 +336,8 @@ protected float calculateSlope(final ChunkMD chunkMd, final Collection<BlockCoor
}
slopeSum += ((y * 1f) / offsetHeight);
}
Float slope = slopeSum / offsets.size();
if (slope.isNaN())
float slope = slopeSum / offsets.size();
if (Float.isNaN(slope))
{
slope = 1f;
}
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/journeymap/client/data/DataCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,11 @@ public class DataCache
final Cache<String, MapType> mapTypes;
final LoadingCache<Long, ChunkMD> chunkMetadata;
final ProxyRemovalListener<Long, ChunkMD> chunkMetadataRemovalListener;
final HashMap<Cache, String> managedCaches = new HashMap<Cache, String>();
final WeakHashMap<Cache, String> privateCaches = new WeakHashMap<Cache, String>();
final Map<Cache, String> managedCaches = new HashMap<>();
final Map<Cache, String> privateCaches = new WeakHashMap<>();
private final int chunkCacheExpireSeconds = 30;
private final int defaultConcurrencyLevel = 1;


// Private constructor
private DataCache()
{
Expand Down

0 comments on commit 755f77a

Please sign in to comment.