File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
src/test/kotlin/com/igorwojda/cache/advancedlru Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -11,11 +11,11 @@ private object Solution1 {
11
11
12
12
fun put (key : String , value : Int , priority : Int , expiryTime : Long ) {
13
13
if (map.containsKey(key)) {
14
- this . remove(key)
14
+ remove(key)
15
15
}
16
16
17
17
if (map.size == capacity) {
18
- this . clearCache()
18
+ clearCache()
19
19
}
20
20
21
21
val item = CacheItem (key, value, priority, expiryTime)
@@ -69,9 +69,9 @@ private object Solution1 {
69
69
70
70
override fun compareTo (other : CacheItem ): Int {
71
71
return when {
72
- this . expiryTime != other.expiryTime -> this . expiryTime.compareTo(other.expiryTime)
73
- this . priority != other.priority -> this . priority.compareTo(other.priority)
74
- else -> this . lastUsed.compareTo(other.lastUsed)
72
+ expiryTime != other.expiryTime -> expiryTime.compareTo(other.expiryTime)
73
+ priority != other.priority -> priority.compareTo(other.priority)
74
+ else -> lastUsed.compareTo(other.lastUsed)
75
75
}
76
76
}
77
77
}
You can’t perform that action at this time.
0 commit comments