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) {
21
21
TODO (" Add your solution here" )
22
22
}
23
23
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
-
41
24
// Returns fixed system time in milliseconds
42
25
private fun getSystemTimeForExpiry () = 1000
43
26
}
You can’t perform that action at this time.
0 commit comments