Lint fixes, likely nothing broke

This commit is contained in:
Jobobby04
2020-04-22 17:26:46 -04:00
parent efb8555d76
commit 959bad0247
16 changed files with 160 additions and 215 deletions
+1 -1
View File
@@ -18,7 +18,7 @@ class CachedField<T>(private val expiresAfterMs: Long) {
content = producer()
}
content as T
content!!
}
}
}
+2 -2
View File
@@ -35,12 +35,12 @@ class DeferredField<T> {
*/
suspend fun get(): T {
// Check if field is initialized and return immediately if it is
if (initialized) return content as T
if (initialized) return content!!
// Wait for field to initialize
mutex.withLock {}
// Field is initialized, return value
return content as T
return content!!
}
}
+3 -3
View File
@@ -14,7 +14,7 @@ class NakedTrieNode<T>(val key: Int, var parent: NakedTrieNode<T>?) {
inline fun walk(prefix: String, consumer: (String, T) -> Boolean, leavesOnly: Boolean) {
// Special case root
if (hasData && (!leavesOnly || children.size() <= 0)) {
if (!consumer(prefix, data as T)) return
if (!consumer(prefix, data!! as T)) return
}
val stack = LinkedList<Pair<String, NakedTrieNode<T>>>()
@@ -27,7 +27,7 @@ class NakedTrieNode<T>(val key: Int, var parent: NakedTrieNode<T>?) {
stack += key + it.key.toChar() to it
}
if (bottom.hasData && (!leavesOnly || bottom.children.size() <= 0)) {
if (!consumer(key, bottom.data as T)) return
if (!consumer(key, bottom.data!! as T)) return
}
}
}
@@ -195,7 +195,7 @@ class NakedTrie<T> : MutableMap<String, T> {
version++
}
return current.data as T
return current.data!!
}
// Includes root