Skip to content

Commit

Permalink
Use constant, not magic number.
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Hunt committed Jun 29, 2016
1 parent b20aa7d commit 9196e42
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/com/meowster/mcquad/RegionFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -232,15 +232,15 @@ boolean chunkAvailableAt(int x, int z) {
* @return true if chunk data is here; false otherwise
*/
int timeStampAt(int x, int z) {
return outOfBounds(x, z) ? 0 : chunkTimestamps[x + z * 32];
return outOfBounds(x, z) ? 0 : chunkTimestamps[x + z * NCHUNKS];
}

private boolean outOfBounds(int x, int z) {
return x < 0 || x >= NCHUNKS || z < 0 || z >= NCHUNKS;
}

private int getOffset(int x, int z) {
return offsets[x + z * 32];
return offsets[x + z * NCHUNKS];
}

private ByteArrayInputStream getDataStream(int length) throws IOException {
Expand Down

0 comments on commit 9196e42

Please sign in to comment.