aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl/treksoft/kvision/utils/Cache.kt
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2019-04-22 21:58:19 +0200
committerRobert Jaros <rjaros@finn.pl>2019-04-22 21:58:19 +0200
commit821883e06af48d5557a12475d9f08ff1d5c39f1c (patch)
treeda3fd2ccc656ecebf7b93b655ad8af956fe814d7 /src/main/kotlin/pl/treksoft/kvision/utils/Cache.kt
parent6f7736b85e0889aff26860e2960f52b301f460c5 (diff)
downloadkvision-821883e06af48d5557a12475d9f08ff1d5c39f1c.tar.gz
kvision-821883e06af48d5557a12475d9f08ff1d5c39f1c.tar.bz2
kvision-821883e06af48d5557a12475d9f08ff1d5c39f1c.zip
Code style fixes.
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/utils/Cache.kt')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/utils/Cache.kt26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/utils/Cache.kt b/src/main/kotlin/pl/treksoft/kvision/utils/Cache.kt
index 6a473661..5b4306df 100644
--- a/src/main/kotlin/pl/treksoft/kvision/utils/Cache.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/utils/Cache.kt
@@ -95,27 +95,27 @@ class LinkedList<T> {
fun last(): Node<T>? {
var node = head
- if (node != null) {
+ return if (node != null) {
while (node?.next != null) {
node = node.next
}
- return node
+ node
} else {
- return null
+ null
}
}
fun count(): Int {
var node = head
- if (node != null) {
+ return if (node != null) {
var counter = 1
while (node?.next != null) {
node = node.next
counter += 1
}
- return counter
+ counter
} else {
- return 0
+ 0
}
}
@@ -167,19 +167,19 @@ class LinkedList<T> {
fun removeLast(): T? {
val last = this.last()
- if (last != null) {
- return removeNode(last)
+ return if (last != null) {
+ removeNode(last)
} else {
- return null
+ null
}
}
fun removeAtIndex(index: Int): T? {
val node = nodeAtIndex(index)
- if (node != null) {
- return removeNode(node)
+ return if (node != null) {
+ removeNode(node)
} else {
- return null
+ null
}
}
@@ -193,6 +193,6 @@ class LinkedList<T> {
s += ", "
}
}
- return s + "]"
+ return "$s]"
}
}