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

Side by Side Diff: runtime/lib/expando_patch.dart

Issue 10911201: Reapply changes to Expando patching. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Move code around a bit. Created 8 years, 3 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 patch class ExpandoImplementation<T> { 5 patch class Expando<T> {
6 /* patch */ T operator[](Object object) { 6 /* patch */ T operator[](Object object) {
7 _checkType(object); 7 _checkType(object);
8 var weakProperty = _find(this); 8 var weakProperty = _find(this);
9 var list = weakProperty.value; 9 var list = weakProperty.value;
10 var doCompact = false; 10 var doCompact = false;
11 var result = null; 11 var result = null;
12 for (int i = 0; i < list.length; ++i) { 12 for (int i = 0; i < list.length; ++i) {
13 var key = list[i].key; 13 var key = list[i].key;
14 if (key === object) { 14 if (key === object) {
15 result = list[i].value; 15 result = list[i].value;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 } 83 }
84 var result = _data[i]; 84 var result = _data[i];
85 if (doCompact) { 85 if (doCompact) {
86 _data = _data.filter((e) => (e !== null)); 86 _data = _data.filter((e) => (e !== null));
87 } 87 }
88 return result; 88 return result;
89 } 89 }
90 90
91 static List _data; 91 static List _data;
92 } 92 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698