Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Mansi-mParticle committed Dec 11, 2024
1 parent fde1b04 commit d90811a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions android-core/src/main/java/com/mparticle/internal/BaseHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ open class BaseHandler : Handler {
private var handling = false
private val messageQueue: ConcurrentHashMap<Message, Boolean> = ConcurrentHashMap<Message, Boolean>()

fun getMessageQueue(): Set<Message?> {
fun getMessageQueue(): Set<Message> {
return messageQueue.keys
}

Expand Down Expand Up @@ -75,12 +75,10 @@ open class BaseHandler : Handler {
}

fun removeMessage(what: Int) {
val messages: Set<Message?> = messageQueue.keys
val messages: Set<Message> = messageQueue.keys
for (message in messages) {
message?.let {
if (message.what == what) {
messageQueue.remove(message)
}
if (message.what == what) {
messageQueue.remove(message)
}
}
super.removeMessages(what)
Expand Down

0 comments on commit d90811a

Please sign in to comment.