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

Side by Side Diff: pkg/compiler/lib/src/util/maplet.dart

Issue 1859343004: dartfmt pkg/compiler (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 dart2js.util.maplet; 5 library dart2js.util.maplet;
6 6
7 import 'dart:collection' show MapBase, IterableBase; 7 import 'dart:collection' show MapBase, IterableBase;
8 8
9 class Maplet<K, V> extends MapBase<K, V> { 9 class Maplet<K, V> extends MapBase<K, V> {
10 static const _MARKER = const _MapletMarker(); 10 static const _MARKER = const _MapletMarker();
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 } else if (_key == key) { 94 } else if (_key == key) {
95 _value = value; 95 _value = value;
96 } else { 96 } else {
97 List list = new List(CAPACITY * 2); 97 List list = new List(CAPACITY * 2);
98 list[0] = _key; 98 list[0] = _key;
99 list[1] = key; 99 list[1] = key;
100 list[CAPACITY] = _value; 100 list[CAPACITY] = _value;
101 list[CAPACITY + 1] = value; 101 list[CAPACITY + 1] = value;
102 _key = list; 102 _key = list;
103 _value = null; 103 _value = null;
104 _extra = 2; // Two elements. 104 _extra = 2; // Two elements.
105 } 105 }
106 } else if (_MARKER == _extra) { 106 } else if (_MARKER == _extra) {
107 _key[key] = value; 107 _key[key] = value;
108 } else { 108 } else {
109 int remaining = _extra; 109 int remaining = _extra;
110 int index = 0; 110 int index = 0;
111 int copyTo, copyFrom; 111 int copyTo, copyFrom;
112 while (remaining > 0 && index < CAPACITY) { 112 while (remaining > 0 && index < CAPACITY) {
113 var candidate = _key[index]; 113 var candidate = _key[index];
114 if (_MARKER == candidate) { 114 if (_MARKER == candidate) {
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 var candidate = _list[_index++]; 270 var candidate = _list[_index++];
271 if (Maplet._MARKER != candidate) { 271 if (Maplet._MARKER != candidate) {
272 _current = candidate; 272 _current = candidate;
273 _remaining--; 273 _remaining--;
274 return true; 274 return true;
275 } 275 }
276 } 276 }
277 _current = null; 277 _current = null;
278 return false; 278 return false;
279 } 279 }
280 } 280 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/util/link_implementation.dart ('k') | pkg/compiler/lib/src/util/setlet.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698