Get rid of bytecodes for list literals.
Just compile them to: new List .add(...) .add(...) ... Gets rid of some code in the interpreter loop, which is always good. Also addresses the old limitation where a list literal could only have 255 elements.
This commit is contained in:
+2
-2
@@ -1,6 +1,6 @@
|
||||
class Sequence {
|
||||
map(f) {
|
||||
var result = []
|
||||
var result = new List
|
||||
for (element in this) {
|
||||
result.add(f.call(element))
|
||||
}
|
||||
@@ -8,7 +8,7 @@ class Sequence {
|
||||
}
|
||||
|
||||
where(f) {
|
||||
var result = []
|
||||
var result = new List
|
||||
for (element in this) {
|
||||
if (f.call(element)) result.add(element)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user