Use forValidRefs in field synchronizer
This commit is contained in:
parent
82389a5e72
commit
5efe3a2e35
@ -369,17 +369,7 @@ class FieldSynchronizer(private val callback: Runnable, private val alwaysCallCa
|
||||
nextEndpointsCleanup = secondTime + 60
|
||||
|
||||
synchronized(endpoints) {
|
||||
val iterator = endpoints.listIterator()
|
||||
|
||||
for (value in iterator) {
|
||||
val endpoint = value.get()
|
||||
|
||||
if (endpoint == null) {
|
||||
iterator.remove()
|
||||
} else {
|
||||
execute.invoke(endpoint)
|
||||
}
|
||||
}
|
||||
endpoints.forValidRefs { execute.invoke(it) }
|
||||
|
||||
if (endpoints.size < endpointsMaxCapacity / 2) {
|
||||
endpoints.trimToSize()
|
||||
|
Loading…
Reference in New Issue
Block a user