Remove js custom emptyList()/emptyMap() implementation.
This commit is contained in:
@@ -3,21 +3,6 @@ package java.util.Collections
|
|||||||
import java.lang.*
|
import java.lang.*
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
// TODO write tests for empty*
|
|
||||||
|
|
||||||
// TODO should be immutable!
|
|
||||||
public val emptyList: List<Any> = ArrayList<Any>()
|
|
||||||
public val emptyMap: Map<Any, Any> = HashMap<Any,Any>()
|
|
||||||
|
|
||||||
public val <T> EMPTY_LIST: List<T>
|
|
||||||
get() = emptyList<T>()
|
|
||||||
|
|
||||||
public val <K,V> EMPTY_MAP: Map<K,V>
|
|
||||||
get() = emptyMap<K,V>()
|
|
||||||
|
|
||||||
public fun <T> emptyList(): List<T> = emptyList as List<T>
|
|
||||||
public fun <K,V> emptyMap(): Map<K,V> = emptyMap as Map<K,V>
|
|
||||||
|
|
||||||
public fun <T> reverse(list: MutableList<T>): Unit {
|
public fun <T> reverse(list: MutableList<T>): Unit {
|
||||||
val size = list.size()
|
val size = list.size()
|
||||||
for (i in 0..(size / 2) - 1) {
|
for (i in 0..(size / 2) - 1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user