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

Unified Diff: sdk/lib/collection/queue.dart

Issue 12213010: New implementation of {,Linked}Hash{Set,Map}. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Made null elements work again, added tests for null. Created 7 years, 10 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/collection/queue.dart
diff --git a/sdk/lib/collection/queue.dart b/sdk/lib/collection/queue.dart
index e11f3ee5866154606075696ae36bf3cc3bb963e6..13ec536544a9b02b94fa9c5a2ebeedf51329a1cc 100644
--- a/sdk/lib/collection/queue.dart
+++ b/sdk/lib/collection/queue.dart
@@ -359,7 +359,8 @@ class ListQueue<E> extends Collection<E> implements Queue<E>{
factory ListQueue.from(Iterable<E> source) {
if (source is List) {
int length = source.length;
- ListQueue<E> queue = new ListQueue(length);
+ ListQueue<E> queue = new ListQueue(length + 1);
+ assert(queue._table.length > length);
List sourceList = source;
queue._table.setRange(0, length, sourceList, 0);
queue._tail = length;

Powered by Google App Engine
This is Rietveld 408576698