Skip to content

Commit f85a6fb

Browse files
committed
Fix an Animal Sniffer violation
1 parent 07a7a41 commit f85a6fb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ui/kotlinx-coroutines-android/src/HandlerDispatcher.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ internal class HandlerContext private constructor(
171171

172172
override fun equals(other: Any?): Boolean =
173173
other is HandlerContext && other.handler === handler && other.invokeImmediately == invokeImmediately
174-
override fun hashCode(): Int = System.identityHashCode(handler) xor invokeImmediately.hashCode()
174+
// inlining `Boolean.hashCode()` for Android compatibility, as requested by Animal Sniffer
175+
override fun hashCode(): Int = System.identityHashCode(handler) xor if (invokeImmediately) 1231 else 1237
175176
}
176177

177178
@Volatile

0 commit comments

Comments
 (0)