Skip to content

Commit

Permalink
refactor: relocate collections utilities and cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
romainbsl committed Jan 7, 2025
1 parent 38d939e commit 0ff876e
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ internal actual fun <K, V> newConcurrentMap(): MutableMap<K, V> = HashMap()
internal actual fun <T> newLinkedList(): MutableList<T> = ArrayList()
internal actual fun <T> newLinkedList(c: Collection<T>): MutableList<T> = ArrayList(c)

public actual inline fun <R> maySynchronized(lock: Any?, block: () -> R): R = block()
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,3 @@ import java.util.concurrent.ConcurrentHashMap
internal actual fun <K, V> newConcurrentMap(): MutableMap<K, V> = ConcurrentHashMap()
internal actual fun <T> newLinkedList(): MutableList<T> = LinkedList()
internal actual fun <T> newLinkedList(c: Collection<T>): MutableList<T> = LinkedList(c)

public actual inline fun <R> maySynchronized(lock: Any?, block: () -> R): R =
if (lock == null)
block()
else
synchronized(lock, block)
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@ package org.kodein.di.internal
internal actual fun <K, V> newConcurrentMap(): MutableMap<K, V> = HashMap()
internal actual fun <T> newLinkedList(): MutableList<T> = ArrayList()
internal actual fun <T> newLinkedList(c: Collection<T>): MutableList<T> = ArrayList(c)

public actual inline fun <R> maySynchronized(lock: Any?, block: () -> R): R = block()

0 comments on commit 0ff876e

Please sign in to comment.