Lint fixes, likely nothing broke
This commit is contained in:
@@ -18,7 +18,7 @@ class CachedField<T>(private val expiresAfterMs: Long) {
|
||||
content = producer()
|
||||
}
|
||||
|
||||
content as T
|
||||
content!!
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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!!
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user