1
0
forked from Mirror/wren

Fix iterating over an empty list.

This commit is contained in:
Bob Nystrom
2014-02-14 17:24:06 -08:00
parent e519ecbc49
commit ca7ff222fe
4 changed files with 25 additions and 22 deletions

View File

@ -10,17 +10,13 @@ class List {
}
+ that {
var newList = []
if (this.count > 0) {
for (element in this) {
newList.add(element)
}
var result = []
for (element in this) {
result.add(element)
}
if (that is Range || that.count > 0) {
for (element in that) {
newList.add(element)
}
for (element in that) {
result.add(element)
}
return newList
return result
}
}