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

Unified Diff: runtime/lib/growable_array.dart

Issue 280843002: - Remove unnecessary is-check. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/growable_array.dart
===================================================================
--- runtime/lib/growable_array.dart (revision 35989)
+++ runtime/lib/growable_array.dart (working copy)
@@ -19,23 +19,14 @@
// (with a length that has been increased, but without a new element).
if (index is! int) throw new ArgumentError(index);
this.length++;
- Lists.copy(this,
- index,
- this,
- index + 1,
- oldLength - index);
+ Lists.copy(this, index, this, index + 1, oldLength - index);
this[index] = element;
}
T removeAt(int index) {
- if (index is! int) throw new ArgumentError(index);
- T result = this[index];
+ var result = this[index];
int newLength = this.length - 1;
- Lists.copy(this,
- index + 1,
- this,
- index,
- newLength - index);
+ Lists.copy(this, index + 1, this, index, newLength - index);
this.length = newLength;
return result;
}
@@ -96,11 +87,7 @@
void removeRange(int start, int end) {
Lists.indicesCheck(this, start, end);
- Lists.copy(this,
- end,
- this,
- start,
- this.length - end);
+ Lists.copy(this, end, this, start, this.length - end);
this.length = this.length - (end - start);
}
« 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