Skip to content

Commit

Permalink
improve readability
Browse files Browse the repository at this point in the history
  • Loading branch information
xGinko committed Dec 24, 2023
1 parent f2f4d46 commit 018d768
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,22 @@ final class Default implements TPSCache {

@Override
public double getGlobalTPS() {
return getTPS(null);
Double tps = this.cached_tps.getIfPresent(true);
if (tps == null) {
tps = this.server.getTPS()[0];
this.cached_tps.put(true, tps);
}
return tps;
}

@Override
public double getTPS(final World world, final int chunkX, final int chunkZ) {
return getTPS(null);
return getGlobalTPS();
}

@Override
public double getTPS(Location location) {
Double tps = this.cached_tps.getIfPresent(true);
if (tps == null) {
tps = this.server.getTPS()[0];
this.cached_tps.put(true, tps);
}
return tps;
return getGlobalTPS();
}
}

Expand Down

0 comments on commit 018d768

Please sign in to comment.