optimizations for instanceof List<*>

This commit is contained in:
Alex Tkachman
2011-12-14 12:44:07 +02:00
committed by Nikolay Krasko
parent 20d339e2da
commit 307040968c
3 changed files with 14 additions and 10 deletions
+2 -2
View File
@@ -30,7 +30,7 @@ class StandardFList<T> (override val head: T, override val tail: FList<T>) : FLi
fun <T> FList<T>.plus2(element: T): FList<T> =
when(this) {
is EmptyFList<T> => OneElementFList<T>(element)
is EmptyFList<*> => OneElementFList<T>(element)
else => StandardFList<T>(element, this)
}
@@ -67,4 +67,4 @@ fun main(args: Array<String>) {
System.out?.println(System.currentTimeMillis() - start2)
System.out?.println()
}
}
}