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

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

Issue 2998053002: Fix unnecessary use of this.length in ListMixin. (Closed)
Patch Set: Fix unnecessary use of this.length in ListMixin. Created 3 years, 4 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: sdk/lib/collection/list.dart
diff --git a/sdk/lib/collection/list.dart b/sdk/lib/collection/list.dart
index 92b1110b192500795207b14ccb9491d57c7b696c..3ce8ee27df06d8d4cd9950b05203e88caa8b6fa8 100644
--- a/sdk/lib/collection/list.dart
+++ b/sdk/lib/collection/list.dart
@@ -89,7 +89,7 @@ abstract class ListMixin<E> implements List<E> {
bool contains(Object element) {
int length = this.length;
- for (int i = 0; i < this.length; i++) {
+ for (int i = 0; i < length; i++) {
if (this[i] == element) return true;
if (length != this.length) {
throw new ConcurrentModificationError(this);
« 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