From 46955ddcbc1e80fa3afaf103a5aaf6a99778c312 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 17 Oct 2015 20:43:31 -0400 Subject: [PATCH] move named/whirlpool out of member fields --- .../java/net/runelite/cache/fs/Index.java | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/main/java/net/runelite/cache/fs/Index.java b/src/main/java/net/runelite/cache/fs/Index.java index c5b30599f8..4e4d1c807a 100644 --- a/src/main/java/net/runelite/cache/fs/Index.java +++ b/src/main/java/net/runelite/cache/fs/Index.java @@ -9,7 +9,6 @@ import java.util.List; import java.util.Objects; import net.runelite.cache.fs.io.InputStream; import net.runelite.cache.fs.io.OutputStream; -import net.runelite.cache.fs.util.CRC32HGenerator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -20,7 +19,6 @@ public class Index implements Closeable private final Store store; private final IndexFile index; private final int id; - private boolean named, usesWhirpool; private int revision; private final List archives = new ArrayList<>(); @@ -140,8 +138,8 @@ public class Index implements Closeable } int hash = stream.readUnsignedByte(); - this.named = (1 & hash) != 0; - this.usesWhirpool = (2 & hash) != 0; + boolean named = (1 & hash) != 0; + boolean usesWhirpool = (2 & hash) != 0; int validArchivesCount = protocol >= 7 ? stream.readBigSmart() : stream.readUnsignedShort(); int lastArchiveId = 0; @@ -154,7 +152,7 @@ public class Index implements Closeable this.archives.add(a); } - if (this.named) + if (named) { for (index = 0; index < validArchivesCount; ++index) { @@ -164,7 +162,7 @@ public class Index implements Closeable } } - if (this.usesWhirpool) + if (usesWhirpool) { for (index = 0; index < validArchivesCount; ++index) { @@ -207,7 +205,7 @@ public class Index implements Closeable a.load(stream, numberOfFiles[index], protocol); } - if (this.named) + if (named) { for (index = 0; index < validArchivesCount; ++index) { @@ -367,8 +365,8 @@ public class Index implements Closeable stream.writeInt(this.revision); } - this.named = true; - stream.writeByte((this.named ? 1 : 0) | (this.usesWhirpool ? 2 : 0)); + boolean named = true, usesWhirpool = false; + stream.writeByte((named ? 1 : 0) | (usesWhirpool ? 2 : 0)); if (protocol >= 7) { stream.writeBigSmart(this.archives.size()); @@ -400,7 +398,7 @@ public class Index implements Closeable } } - if (this.named) + if (named) { for (data = 0; data < this.archives.size(); ++data) { @@ -409,7 +407,7 @@ public class Index implements Closeable } } - if (this.usesWhirpool) + if (usesWhirpool) { for (data = 0; data < this.archives.size(); ++data) { @@ -473,7 +471,7 @@ public class Index implements Closeable } } - if (this.named) + if (named) { for (data = 0; data < this.archives.size(); ++data) {