File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
lib-compose/src/main/java/com/what3words/components/compose/maps/extensions Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -3,13 +3,14 @@ package com.what3words.components.compose.maps.extensions
33import com.what3words.components.compose.maps.models.W3WMarker
44import com.what3words.core.types.common.W3WError
55import com.what3words.core.types.common.W3WResult
6+ import java.util.Collections
67
78internal fun MutableMap <String , MutableList <W3WMarker >>.addMarker (
89 listName : String ,
910 marker : W3WMarker ,
1011): W3WResult <W3WMarker > {
1112 // Get or create the current list of markers (using MutableList for in-place updates)
12- val currentList = this .getOrPut(listName) { mutableListOf () }
13+ val currentList = this .getOrPut(listName) { Collections .synchronizedList( mutableListOf () ) }
1314
1415 // Check if a marker with the same ID already exists
1516 val index = currentList.indexOfFirst { it.square.id == marker.square.id }
You can’t perform that action at this time.
0 commit comments