Skip to content

Commit f7785e1

Browse files
committed
Clean up
1 parent a9c482e commit f7785e1

File tree

1 file changed

+5
-5
lines changed
  • src/test/kotlin/com/igorwojda/cache/advancedlru

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ private object Solution1 {
1111

1212
fun put(key: String, value: Int, priority: Int, expiryTime: Long) {
1313
if (map.containsKey(key)) {
14-
this.remove(key)
14+
remove(key)
1515
}
1616

1717
if (map.size == capacity) {
18-
this.clearCache()
18+
clearCache()
1919
}
2020

2121
val item = CacheItem(key, value, priority, expiryTime)
@@ -69,9 +69,9 @@ private object Solution1 {
6969

7070
override fun compareTo(other: CacheItem): Int {
7171
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)
7575
}
7676
}
7777
}

0 commit comments

Comments
 (0)