Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Unified Diff: samples/swarm/swarm_ui_lib/observable/observable.dart

Issue 12386072: Move Arrays class to private library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/lib/simd128.dart ('k') | sdk/lib/_collection_dev/arrays.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/swarm/swarm_ui_lib/observable/observable.dart
diff --git a/samples/swarm/swarm_ui_lib/observable/observable.dart b/samples/swarm/swarm_ui_lib/observable/observable.dart
index 794541c1dbd3c1faa5422fbb5f459d608fa64847..e60b8a92ee23585f7eca59833ebcd1a5cb3f3c35 100644
--- a/samples/swarm/swarm_ui_lib/observable/observable.dart
+++ b/samples/swarm/swarm_ui_lib/observable/observable.dart
@@ -239,7 +239,20 @@ class ObservableList<T>
}
void copyFrom(List<T> src, int srcStart, int dstStart, int count) {
- Arrays.copy(src, srcStart, this, dstStart, count);
+ List dst = this;
+ if (srcStart == null) srcStart = 0;
+ if (dstStart == null) dstStart = 0;
+
+ 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];
+ }
+ }
}
void setRange(int start, int length, List from, [int startFrom = 0]) {
« no previous file with comments | « runtime/lib/simd128.dart ('k') | sdk/lib/_collection_dev/arrays.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698