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

Side by Side Diff: frog/lib/corelib_impl.dart

Issue 8983019: Native implementation of List,setRange for frog. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 #library("dart:coreimpl"); 5 #library("dart:coreimpl");
6 6
7 #source("../../corelib/src/implementation/dual_pivot_quicksort.dart"); 7 #source("../../corelib/src/implementation/dual_pivot_quicksort.dart");
8 #source("../../corelib/src/implementation/duration_implementation.dart"); 8 #source("../../corelib/src/implementation/duration_implementation.dart");
9 #source("../../corelib/src/implementation/exceptions.dart"); 9 #source("../../corelib/src/implementation/exceptions.dart");
10 #source("../../corelib/src/implementation/future_implementation.dart"); 10 #source("../../corelib/src/implementation/future_implementation.dart");
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 int lastIndexOf(E element, [int start]) native; 65 int lastIndexOf(E element, [int start]) native;
66 void clear() { length = 0; } 66 void clear() { length = 0; }
67 67
68 E removeLast() native "return this.pop();"; 68 E removeLast() native "return this.pop();";
69 69
70 E last() => this[this.length-1]; 70 E last() => this[this.length-1];
71 71
72 List<E> getRange(int start, int length) native 72 List<E> getRange(int start, int length) native
73 "return this.slice(start, start + length);"; 73 "return this.slice(start, start + length);";
74 74
75 void setRange(int start, int length, List<E> from, [int startFrom]) native; 75 void setRange(int start, int length, List<E> from, [int startFrom]) native
76 """
77 startFrom = (startFrom === null ? 0 : startFrom);
jimhug 2012/01/04 17:38:17 startFrom == null will do the correct comparison o
dominich 2012/01/05 18:19:57 Done.
78 for (var i = 0; i < length; ++i)
79 this[start + i] = from[startFrom + i];
80 """;
76 void removeRange(int start, int length) native "this.splice(start, length);"; 81 void removeRange(int start, int length) native "this.splice(start, length);";
77 82
78 void insertRange(int start, int length, [E initialValue]) native 83 void insertRange(int start, int length, [E initialValue]) native
79 """ 84 """
80 // Splice in the values with a minimum of array allocations. 85 // Splice in the values with a minimum of array allocations.
81 var args = new Array(length + 2); 86 var args = new Array(length + 2);
82 args[0] = start; 87 args[0] = start;
83 args[1] = 0; 88 args[1] = 0;
84 for (var i = 0; i < length; i++) { 89 for (var i = 0; i < length; i++) {
85 args[i + 2] = initialValue; 90 args[i + 2] = initialValue;
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 } else if (isNaN()) { 452 } else if (isNaN()) {
448 if (other.isNaN()) { 453 if (other.isNaN()) {
449 return 0; 454 return 0;
450 } 455 }
451 return 1; 456 return 1;
452 } else { 457 } else {
453 return -1; 458 return -1;
454 } 459 }
455 } 460 }
456 } 461 }
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