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

Side by Side Diff: runtime/lib/array.dart

Issue 14468004: Fix missing concurrency check in [].forEach. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added comment about iteration order of lists. Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/lib/growable_array.dart » ('j') | runtime/lib/growable_array.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 5
6 // TODO(srdjan): Use shared array implementation. 6 // TODO(srdjan): Use shared array implementation.
7 class _ObjectArray<E> implements List<E> { 7 class _ObjectArray<E> implements List<E> {
8 8
9 factory _ObjectArray(length) native "ObjectArray_allocate"; 9 factory _ObjectArray(length) native "ObjectArray_allocate";
10 10
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 60
61 Iterable<E> getRange(int start, [int end]) { 61 Iterable<E> getRange(int start, [int end]) {
62 return IterableMixinWorkaround.getRangeList(this, start, end); 62 return IterableMixinWorkaround.getRangeList(this, start, end);
63 } 63 }
64 64
65 // List interface. 65 // List interface.
66 void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]) { 66 void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]) {
67 if (start < 0 || start > this.length) { 67 if (start < 0 || start > this.length) {
68 throw new RangeError.range(start, 0, this.length); 68 throw new RangeError.range(start, 0, this.length);
69 } 69 }
70 if (end < 0 || end > this.length) { 70 if (end < start || end > this.length) {
71 throw new RangeError.range(end, start, this.length); 71 throw new RangeError.range(end, start, this.length);
72 } 72 }
73 int length = end - start; 73 int length = end - start;
74 if (length == 0) return; 74 if (length == 0) return;
75 75
76 if (iterable is _ObjectArray) { 76 if (iterable is _ObjectArray) {
77 _copyFromObjectArray(iterable, skipCount, start, length); 77 _copyFromObjectArray(iterable, skipCount, start, length);
78 } else { 78 } else {
79 List otherList; 79 List otherList;
80 int otherStart; 80 int otherStart;
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 } 543 }
544 _position = _length; 544 _position = _length;
545 _current = null; 545 _current = null;
546 return false; 546 return false;
547 } 547 }
548 548
549 E get current { 549 E get current {
550 return _current; 550 return _current;
551 } 551 }
552 } 552 }
OLDNEW
« no previous file with comments | « no previous file | runtime/lib/growable_array.dart » ('j') | runtime/lib/growable_array.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698