Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
Saloed committed Dec 16, 2024
1 parent 35cc966 commit 64e6c9a
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,19 @@ sealed class USymbolicSetUnionAdapter<
this(WeakReference(key), composer?.let { WeakReference(it) }, result)

Check warning

Code scanning / detekt

Reports mis-indented code Warning

Unexpected indentation (16) (should be 12)

fun containsCachedValue(key: Key, composer: UComposer<*, *>?): Boolean {
val thisKey = this.key.get() ?: return false
if (thisKey != key) return false
if (!this.key.equalTo(key)) return false

if (composer == null) {
return this.composer == null
}
val thisComposer = this.composer ?: return composer == null
if (composer == null) return false

return thisComposer.equalTo(composer)
}

val thisComposer = this.composer?.get() ?: return false
return thisComposer == composer
companion object {
private fun <T> WeakReference<T>.equalTo(other: T): Boolean {
val value = get() ?: return false
return value == other
}
}
}
}
Expand Down

0 comments on commit 64e6c9a

Please sign in to comment.