Code review fixes.

This commit is contained in:
Onuray Sahin 2022-03-25 13:58:48 +03:00
parent 79afdf724f
commit 7285bc6889

View file

@ -93,19 +93,15 @@ class LocationTracker @Inject constructor(
}
fun addCallback(callback: Callback) {
synchronized(callbacks) {
if (!callbacks.contains(callback)) {
callbacks.add(callback)
}
if (!callbacks.contains(callback)) {
callbacks.add(callback)
}
}
fun removeCallback(callback: Callback) {
synchronized(callbacks) {
callbacks.remove(callback)
if (callbacks.size == 0) {
stop()
}
callbacks.remove(callback)
if (callbacks.size == 0) {
stop()
}
}