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

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

Issue 126933004: Fix issue 15134: use fast setRange for setAll in TypedDataBase. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 11 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 // patch classes for Int8List ..... Float64List and ByteData implementations. 5 // patch classes for Int8List ..... Float64List and ByteData implementations.
6 6
7 patch class Int8List { 7 patch class Int8List {
8 /* patch */ factory Int8List(int length) { 8 /* patch */ factory Int8List(int length) {
9 return new _Int8Array(length); 9 return new _Int8Array(length);
10 } 10 }
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 this[i] = temp_buffer[i - start]; 573 this[i] = temp_buffer[i - start];
574 } 574 }
575 return; 575 return;
576 } 576 }
577 } 577 }
578 IterableMixinWorkaround.setRangeList(this, start, 578 IterableMixinWorkaround.setRangeList(this, start,
579 end, from, skipCount); 579 end, from, skipCount);
580 } 580 }
581 581
582 void setAll(int index, Iterable iterable) { 582 void setAll(int index, Iterable iterable) {
583 IterableMixinWorkaround.setAllList(this, index, iterable); 583 final end = iterable.length + index;
584 setRange(index, end, iterable);
584 } 585 }
585 586
586 void fillRange(int start, int end, [fillValue]) { 587 void fillRange(int start, int end, [fillValue]) {
587 IterableMixinWorkaround.fillRangeList(this, start, end, fillValue); 588 IterableMixinWorkaround.fillRangeList(this, start, end, fillValue);
588 } 589 }
589 590
590 591
591 // Method(s) implementing Object interface. 592 // Method(s) implementing Object interface.
592 593
593 String toString() { 594 String toString() {
(...skipping 2805 matching lines...) Expand 10 before | Expand all | Expand 10 after
3399 return value; 3400 return value;
3400 } 3401 }
3401 return object; 3402 return object;
3402 } 3403 }
3403 3404
3404 3405
3405 void _throwRangeError(int index, int length) { 3406 void _throwRangeError(int index, int length) {
3406 String message = "$index must be in the range [0..$length)"; 3407 String message = "$index must be in the range [0..$length)";
3407 throw new RangeError(message); 3408 throw new RangeError(message);
3408 } 3409 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698