Fix stdlib drop and add bytecode return/break test
This commit is contained in:
1 parent
8dfdbaa0a0
commit
7b3d92beb9
2 files changed
+33
-1
No files matched your search
@@ -65,7 +65,11 @@ fun Iterable.filterNotNull(): List {
|
||||
/* Skip the first N elements of this iterable. */
|
||||
fun Iterable.drop(n) {
|
||||
var cnt = 0
|
||||
filter { cnt++ >= n }
|
||||
val result = []
|
||||
for( item in this ) {
|
||||
if( cnt++ >= n ) result.add(item)
|
||||
}
|
||||
result
|
||||
}
|
||||
|
||||
/* Return the first element or throw if the iterable is empty. */
|
||||
|
||||
Reference in new issue
Block a user