Chromium Code Reviews| Index: runtime/lib/internal_patch.dart |
| diff --git a/runtime/lib/internal_patch.dart b/runtime/lib/internal_patch.dart |
| index 88bff92c4803143f6e19e35290a1ab2ac5c05604..57bea3f85d1a714d3bf86087c6b620654c987d63 100644 |
| --- a/runtime/lib/internal_patch.dart |
| +++ b/runtime/lib/internal_patch.dart |
| @@ -43,3 +43,20 @@ bool _classRangeCheck(int cid, int lowerLimit, int upperLimit) { |
| bool _classRangeCheckNegative(int cid, int lowerLimit, int upperLimit) { |
| return cid < lowerLimit || cid > upperLimit; |
| } |
| + |
| +// Utility class now only used by the VM. |
| +class Lists { |
| + static void copy(List src, int srcStart, |
|
floitsch
2017/02/15 17:11:38
Nit: use full names.
That said: I don't think this
Lasse Reichstein Nielsen
2017/02/17 11:25:20
Correct. I dare not touch it, since it seems to be
|
| + List dst, int dstStart, int count) { |
| + if (srcStart < dstStart) { |
| + for (int i = srcStart + count - 1, j = dstStart + count - 1; |
| + i >= srcStart; i--, j--) { |
| + dst[j] = src[i]; |
| + } |
| + } else { |
| + for (int i = srcStart, j = dstStart; i < srcStart + count; i++, j++) { |
| + dst[j] = src[i]; |
| + } |
| + } |
| + } |
| +} |