Skip to content

Commit 15d53ff

Browse files
committed
Clean up
1 parent 0218450 commit 15d53ff

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

src/test/kotlin/com/igorwojda/cache/advancedlru/Challenge.kt

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,6 @@ class AdvancedLRUCache(private val capacity: Int) {
2121
TODO("Add your solution here")
2222
}
2323

24-
private data class CacheItem(
25-
val key: String,
26-
var value: Int,
27-
var priority: Int,
28-
var expiryTime: Long,
29-
) : Comparable<CacheItem> {
30-
var lastUsed: Long = System.currentTimeMillis()
31-
32-
override fun compareTo(other: CacheItem): Int {
33-
return when {
34-
this.expiryTime != other.expiryTime -> this.expiryTime.compareTo(other.expiryTime)
35-
this.priority != other.priority -> this.priority.compareTo(other.priority)
36-
else -> this.lastUsed.compareTo(other.lastUsed)
37-
}
38-
}
39-
}
40-
4124
// Returns fixed system time in milliseconds
4225
private fun getSystemTimeForExpiry() = 1000
4326
}

0 commit comments

Comments
 (0)