Make toTypedArray reified again and thus inline, rewrite copyToArray and copyToArrayImpl in kotlin.
This commit is contained in:
+1
-16
@@ -406,7 +406,7 @@ Kotlin.collectionsSort = function (mutableList, comparator) {
|
||||
}
|
||||
|
||||
if (mutableList.size > 1) {
|
||||
var array = Kotlin.copyToArray(mutableList);
|
||||
var array = _.kotlin.collections.copyToArray(mutableList);
|
||||
|
||||
array.sort(boundComparator);
|
||||
|
||||
@@ -420,21 +420,6 @@ Kotlin.primitiveArraySort = function(array) {
|
||||
array.sort(Kotlin.primitiveCompareTo)
|
||||
};
|
||||
|
||||
Kotlin.copyToArray = function (collection) {
|
||||
if (typeof collection.toArray !== "undefined") return collection.toArray();
|
||||
return Kotlin.copyToArrayImpl(collection);
|
||||
};
|
||||
|
||||
Kotlin.copyToArrayImpl = function (collection) {
|
||||
var array = [];
|
||||
var it = collection.iterator();
|
||||
while (it.hasNext()) {
|
||||
array.push(it.next());
|
||||
}
|
||||
|
||||
return array;
|
||||
};
|
||||
|
||||
Kotlin.splitString = function (str, regex, limit) {
|
||||
return str.split(new RegExp(regex), limit);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user