mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-03 00:38:21 +00:00
Simplify the getter of Crcs
This commit is contained in:
+4
-6
@@ -163,13 +163,11 @@ public final class IndexedFileSystem implements Closeable {
|
||||
* @throws IOException If there is an error accessing files to create the table.
|
||||
*/
|
||||
public int[] getCrcs() throws IOException {
|
||||
if (crcs != null) {
|
||||
return crcs;
|
||||
if (crcs == null) {
|
||||
ByteBuffer buffer = getCrcTable();
|
||||
crcs = new int[(buffer.remaining() / Integer.BYTES) - 1];
|
||||
Arrays.setAll(crcs, crc -> buffer.getInt());
|
||||
}
|
||||
|
||||
ByteBuffer buffer = getCrcTable();
|
||||
crcs = new int[(buffer.remaining() / Integer.BYTES) - 1];
|
||||
Arrays.setAll(crcs, crc -> buffer.getInt());
|
||||
return crcs;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user