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

Side by Side Diff: lib/coreimpl/splay_tree.dart

Issue 10919146: Get rid of a lot of () for getters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
« no previous file with comments | « lib/coreimpl/regexp.dart ('k') | lib/coreimpl/string_buffer.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) 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 /** 5 /**
6 * A node in a splay tree. It holds the key, the value and the left 6 * A node in a splay tree. It holds the key, the value and the left
7 * and right children in the tree. 7 * and right children in the tree.
8 */ 8 */
9 class SplayTreeNode<K, V> { 9 class SplayTreeNode<K, V> {
10 SplayTreeNode(K this.key, V this.value); 10 SplayTreeNode(K this.key, V this.value);
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 while (current.right === null) { 188 while (current.right === null) {
189 if (list.isEmpty()) return; 189 if (list.isEmpty()) return;
190 current = list.removeLast(); 190 current = list.removeLast();
191 f(current.key, current.value); 191 f(current.key, current.value);
192 } 192 }
193 current = current.right; 193 current = current.right;
194 } 194 }
195 } 195 }
196 } 196 }
197 197
198 int get length() { 198 int get length {
199 return _count; 199 return _count;
200 } 200 }
201 201
202 void clear() { 202 void clear() {
203 _root = null; 203 _root = null;
204 _count = 0; 204 _count = 0;
205 } 205 }
206 206
207 bool containsKey(K key) { 207 bool containsKey(K key) {
208 if (!isEmpty()) { 208 if (!isEmpty()) {
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 if (node.key.compareTo(key) > 0) { 297 if (node.key.compareTo(key) > 0) {
298 return visit(node.left, node.key); 298 return visit(node.left, node.key);
299 } 299 }
300 if (node.key.compareTo(key) <= 0) { 300 if (node.key.compareTo(key) <= 0) {
301 return visit(node.right, ifEmpty); 301 return visit(node.right, ifEmpty);
302 } 302 }
303 } 303 }
304 return visit(_root, null); 304 return visit(_root, null);
305 } 305 }
306 } 306 }
OLDNEW
« no previous file with comments | « lib/coreimpl/regexp.dart ('k') | lib/coreimpl/string_buffer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698