Optimize snapshot operations to return special collection implementations when result is empty or has single element.

#KT-9990 Fixed
This commit is contained in:
Ilya Gorbunov
2016-02-10 15:48:05 +03:00
parent 0a5db2fea4
commit f35dc47b4e
10 changed files with 237 additions and 42 deletions
+2
View File
@@ -91,6 +91,8 @@ internal fun <T> arrayPlusCollection(array: dynamic, collection: Collection<T>):
return result
}
// no singleton map implementation in js, return map as is
internal inline fun <K, V> Map<K, V>.toSingletonMap(): Map<K, V> = this
internal inline fun <T> Array<out T>.copyToArrayOfAny(isVarargs: Boolean): Array<out Any?> =
if (isVarargs)