We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9fdb9ba commit 3d362c2Copy full SHA for 3d362c2
src/test/kotlin/com/igorwojda/cache/advancedlru/Solution.kt
@@ -67,12 +67,10 @@ private object Solution1 {
67
) : Comparable<CacheItem> {
68
var lastUsed: Long = System.currentTimeMillis()
69
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
- }
+ override fun compareTo(other: CacheItem) = when {
+ expiryTime != other.expiryTime -> expiryTime.compareTo(other.expiryTime)
+ priority != other.priority -> priority.compareTo(other.priority)
+ else -> lastUsed.compareTo(other.lastUsed)
76
}
77
78
0 commit comments