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>()
|
val c = ArrayList<T>()
|
||||||
for (v in values) {
|
for (v in values) {
|
||||||
c.add(v)
|
c.add(v)
|
||||||
@@ -19,7 +19,7 @@ public inline fun arrayList<T>(vararg values: T): ArrayList<T> {
|
|||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
|
|
||||||
public inline val <T> ArrayList<T>.head: T
|
public val <T> ArrayList<T>.head: T
|
||||||
get() {
|
get() {
|
||||||
return get(0)
|
return get(0)
|
||||||
}
|
}
|
||||||
+2
-2
@@ -8,11 +8,11 @@ public class Foo {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public inline fun Foo.fooImp(): String {
|
public fun Foo.fooImp(): String {
|
||||||
return "impl" + blah()
|
return "impl" + blah()
|
||||||
}
|
}
|
||||||
|
|
||||||
public inline fun Foo.fooExp(): String {
|
public fun Foo.fooExp(): String {
|
||||||
return "expl" + this.blah()
|
return "expl" + this.blah()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package foo
|
|||||||
import java.util.HashMap
|
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()
|
val entrySet = this.entrySet()
|
||||||
return entrySet.iterator()
|
return entrySet.iterator()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ import java.lang.Iterable
|
|||||||
/*
|
/*
|
||||||
Filters given iterator
|
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
|
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) {
|
for (element in this) {
|
||||||
if (filter(element))
|
if (filter(element))
|
||||||
container.add(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
|
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> {
|
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