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

Unified Diff: sdk/lib/core/list.dart

Issue 12383073: Add List.insert. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rename insertAt to insert.~ Created 7 years, 9 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
Index: sdk/lib/core/list.dart
diff --git a/sdk/lib/core/list.dart b/sdk/lib/core/list.dart
index 560f08fe0766941312f5522f11ed53d6a4e1e570..4a4b1c08e659d8742a5eb75f194f2926f04e1260 100644
--- a/sdk/lib/core/list.dart
+++ b/sdk/lib/core/list.dart
@@ -192,7 +192,18 @@ abstract class List<E> implements Collection<E> {
void clear();
/**
- * Removes the element at position[index] from the list.
+ * Inserts the element at position [index] in the list.
+ *
+ * This increases the length of the list by one and moves all later elements
+ * up by one position.
srdjan 2013/03/06 17:08:37 'up' is an interesting direction. I always though
Lasse Reichstein Nielsen 2013/03/07 09:57:53 I'd expect "moving up" to move towards the start.
floitsch 2013/03/07 12:53:53 Changed to "shifts all later elements towards the
+ *
+ * It is an error if the [index] is `null`, or if the [index] does not point
Lasse Reichstein Nielsen 2013/03/07 09:57:53 Skip the null part. That's included in "not pointi
floitsch 2013/03/07 12:53:53 Done.
+ * inside the list or at the position after the last element.
+ */
+ void insert(int index, E element);
+
+ /**
+ * Removes the element at position [index] from the list.
*
* This reduces the length of the list by one and moves all later elements
* down by one position.

Powered by Google App Engine
This is Rietveld 408576698