File tree Expand file tree Collapse file tree 1 file changed +0
-17
lines changed
src/test/kotlin/com/igorwojda/cache/advancedlru Expand file tree Collapse file tree 1 file changed +0
-17
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments