mirror of
https://github.com/mdgriffith/elm-optimize-level-2.git
synced 2024-09-11 12:15:24 +03:00
Merge pull request #74 from jfmengels/list-take-replacement
Add replacement for List.take
This commit is contained in:
commit
895aecc1f6
10
src/replacements/list/$elm$core$List$take.js
Normal file
10
src/replacements/list/$elm$core$List$take.js
Normal file
@ -0,0 +1,10 @@
|
||||
var $elm$core$List$take = F2(function(n, xs) {
|
||||
var tmp = _List_Cons(undefined, _List_Nil);
|
||||
var end = tmp;
|
||||
for (var i = 0; i < n && xs.b; xs = xs.b, i++) {
|
||||
var next = _List_Cons(xs.a, _List_Nil);
|
||||
end.b = next;
|
||||
end = next;
|
||||
}
|
||||
return tmp.b;
|
||||
});
|
Loading…
Reference in New Issue
Block a user