perf(dart): Improve Dart ListWrapper#concat
Improve implementation of `ListWrapper#concat` to take advantage of our knowledge of input list sizes.
This commit is contained in:
parent
08f21dbf51
commit
5114411749
@ -130,9 +130,10 @@ class ListWrapper {
|
|||||||
l.add(e);
|
l.add(e);
|
||||||
}
|
}
|
||||||
static List concat(List a, List b) {
|
static List concat(List a, List b) {
|
||||||
return []
|
return new List()
|
||||||
..addAll(a)
|
..length = a.length + b.length
|
||||||
..addAll(b);
|
..setRange(0, a.length, a)
|
||||||
|
..setRange(a.length, a.length + b.length, b);
|
||||||
}
|
}
|
||||||
static bool isList(l) => l is List;
|
static bool isList(l) => l is List;
|
||||||
static void insert(List l, int index, value) {
|
static void insert(List l, int index, value) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user