From 61d525c5426cb08c5089799458201b0431fcead1 Mon Sep 17 00:00:00 2001 From: Graham Date: Mon, 21 Dec 2020 16:18:47 +0000 Subject: [PATCH] Convert Js5MasterIndex.Entry to a data class Spotted by Desetude. I think this was an accident, as the similar Js5Index.Entry class can't be a data class (as it contains an array). Signed-off-by: Graham --- .../org/openrs2/cache/Js5MasterIndex.kt | 24 +------------------ 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/cache/src/main/kotlin/org/openrs2/cache/Js5MasterIndex.kt b/cache/src/main/kotlin/org/openrs2/cache/Js5MasterIndex.kt index 0d6ad5a4..3ffcc75c 100644 --- a/cache/src/main/kotlin/org/openrs2/cache/Js5MasterIndex.kt +++ b/cache/src/main/kotlin/org/openrs2/cache/Js5MasterIndex.kt @@ -3,29 +3,7 @@ package org.openrs2.cache import io.netty.buffer.ByteBuf public inline class Js5MasterIndex(public val entries: MutableList = mutableListOf()) { - public class Entry(public var version: Int, public var checksum: Int) { - override fun equals(other: Any?): Boolean { - if (this === other) return true - if (javaClass != other?.javaClass) return false - - other as Entry - - if (version != other.version) return false - if (checksum != other.checksum) return false - - return true - } - - override fun hashCode(): Int { - var result = version - result = 31 * result + checksum - return result - } - - override fun toString(): String { - return "Entry{version=$version, checksum=$checksum}" - } - } + public data class Entry(public var version: Int, public var checksum: Int) public fun write(buf: ByteBuf) { for (entry in entries) {