Skip to content

Commit 3d362c2

Browse files
committed
Clean up
1 parent 9fdb9ba commit 3d362c2

File tree

1 file changed

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

1 file changed

+4
-6
lines changed

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,10 @@ private object Solution1 {
6767
) : Comparable<CacheItem> {
6868
var lastUsed: Long = System.currentTimeMillis()
6969

70-
override fun compareTo(other: CacheItem): Int {
71-
return when {
72-
expiryTime != other.expiryTime -> expiryTime.compareTo(other.expiryTime)
73-
priority != other.priority -> priority.compareTo(other.priority)
74-
else -> lastUsed.compareTo(other.lastUsed)
75-
}
70+
override fun compareTo(other: CacheItem) = when {
71+
expiryTime != other.expiryTime -> expiryTime.compareTo(other.expiryTime)
72+
priority != other.priority -> priority.compareTo(other.priority)
73+
else -> lastUsed.compareTo(other.lastUsed)
7674
}
7775
}
7876

0 commit comments

Comments
 (0)