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

Side by Side Diff: samples/swarm/swarm_ui_lib/observable/observable.dart

Issue 13528004: Remove addLast from List. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove typo Created 7 years, 8 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 | « runtime/tests/vm/dart/byte_array_test.dart ('k') | sdk/lib/_collection_dev/list.dart » ('j') | 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 observable; 5 library observable;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 part 'ChangeEvent.dart'; 9 part 'ChangeEvent.dart';
10 part 'EventBatch.dart'; 10 part 'EventBatch.dart';
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 if (compare == null) compare = Comparable.compare; 168 if (compare == null) compare = Comparable.compare;
169 _internal.sort(compare); 169 _internal.sort(compare);
170 recordGlobalChange(); 170 recordGlobalChange();
171 } 171 }
172 172
173 void add(T element) { 173 void add(T element) {
174 recordListInsert(length, element); 174 recordListInsert(length, element);
175 _internal.add(element); 175 _internal.add(element);
176 } 176 }
177 177
178 void addLast(T element) {
179 add(element);
180 }
181
182 void addAll(Iterable<T> elements) { 178 void addAll(Iterable<T> elements) {
183 for (T element in elements) { 179 for (T element in elements) {
184 add(element); 180 add(element);
185 } 181 }
186 } 182 }
187 183
188 int push(T element) { 184 int push(T element) {
189 recordListInsert(length, element); 185 recordListInsert(length, element);
190 _internal.add(element); 186 _internal.add(element);
191 return _internal.length; 187 return _internal.length;
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 // Only fire on an actual change. 335 // Only fire on an actual change.
340 if (!identical(newValue, _value)) { 336 if (!identical(newValue, _value)) {
341 final oldValue = _value; 337 final oldValue = _value;
342 _value = newValue; 338 _value = newValue;
343 recordPropertyUpdate("value", newValue, oldValue); 339 recordPropertyUpdate("value", newValue, oldValue);
344 } 340 }
345 } 341 }
346 342
347 T _value; 343 T _value;
348 } 344 }
OLDNEW
« no previous file with comments | « runtime/tests/vm/dart/byte_array_test.dart ('k') | sdk/lib/_collection_dev/list.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698