Minor in JS backend: drop unnecessary inline annotations.
This commit is contained in:
@@ -11,7 +11,7 @@ fun box(): Boolean {
|
||||
}
|
||||
|
||||
|
||||
public inline fun arrayList<T>(vararg values: T): ArrayList<T> {
|
||||
public fun arrayList<T>(vararg values: T): ArrayList<T> {
|
||||
val c = ArrayList<T>()
|
||||
for (v in values) {
|
||||
c.add(v)
|
||||
@@ -19,7 +19,7 @@ public inline fun arrayList<T>(vararg values: T): ArrayList<T> {
|
||||
return c
|
||||
}
|
||||
|
||||
public inline val <T> ArrayList<T>.head: T
|
||||
public val <T> ArrayList<T>.head: T
|
||||
get() {
|
||||
return get(0)
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -8,11 +8,11 @@ public class Foo {
|
||||
|
||||
}
|
||||
|
||||
public inline fun Foo.fooImp(): String {
|
||||
public fun Foo.fooImp(): String {
|
||||
return "impl" + blah()
|
||||
}
|
||||
|
||||
public inline fun Foo.fooExp(): String {
|
||||
public fun Foo.fooExp(): String {
|
||||
return "expl" + this.blah()
|
||||
}
|
||||
|
||||
@@ -21,4 +21,4 @@ fun box(): Boolean {
|
||||
if (a.fooImp() != "impl5") return false
|
||||
if (a.fooExp() != "expl5") return false
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package foo
|
||||
import java.util.HashMap
|
||||
|
||||
|
||||
public inline fun <K, V> Map<K, V>.iterator(): Iterator<Map.Entry<K, V>> {
|
||||
public fun <K, V> Map<K, V>.iterator(): Iterator<Map.Entry<K, V>> {
|
||||
val entrySet = this.entrySet()
|
||||
return entrySet.iterator()
|
||||
}
|
||||
@@ -38,4 +38,4 @@ fun box(): String {
|
||||
if (s2 != "s2") return "s2 != 's2', it: ${s2}"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,12 +6,12 @@ import java.lang.Iterable
|
||||
/*
|
||||
Filters given iterator
|
||||
*/
|
||||
inline fun <T> java.util.Iterator<T>.filter(f: (T) -> Boolean): java.util.Iterator<T> = FilterIterator<T>(this, f)
|
||||
fun <T> java.util.Iterator<T>.filter(f: (T) -> Boolean): java.util.Iterator<T> = FilterIterator<T>(this, f)
|
||||
|
||||
/*
|
||||
Adds filtered elements in to given container
|
||||
*/
|
||||
inline fun <T, U : Collection<in T>> java.lang.Iterable<T>.filterTo(var container: U, filter: (T) -> Boolean): U {
|
||||
fun <T, U : Collection<in T>> java.lang.Iterable<T>.filterTo(var container: U, filter: (T) -> Boolean): U {
|
||||
for (element in this) {
|
||||
if (filter(element))
|
||||
container.add(element)
|
||||
@@ -23,7 +23,7 @@ inline fun <T, U : Collection<in T>> java.lang.Iterable<T>.filterTo(var containe
|
||||
Create iterator filtering given java.lang.Iterable
|
||||
*/
|
||||
/*
|
||||
inline fun <T> java.lang.Iterable<T>.filter(f: (T)->Boolean) : java.util.Iterator<T> = (iterator() as java.util.Iterator<T>).filter(f)
|
||||
fun <T> java.lang.Iterable<T>.filter(f: (T)->Boolean) : java.util.Iterator<T> = (iterator() as java.util.Iterator<T>).filter(f)
|
||||
*/
|
||||
|
||||
private class FilterIterator<T>(val original: java.util.Iterator<T>, val filter: (T) -> Boolean) : java.util.Iterator<T> {
|
||||
|
||||
Reference in New Issue
Block a user