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

Issue 12260058: Update SplayTreeMap implementation. (Closed)

Created:
7 years, 10 months ago by Lasse Reichstein Nielsen
Modified:
7 years, 10 months ago
Reviewers:
floitsch
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Update SplayTreeMap implementation. Make keys and values getters lazy. Update iteration to not serialize the keys first. Iteration attempts to traverse the tree without modifying it, but recovers if someone modifies the tree structure while iterating, which a simple lookup will do. It throws, as other maps, if keys are added or removed during iteration. Add concurrent modification catching for iteration and putIfAbsent. Make _splay actually private. BUG=http://dartbug.com/4421 Committed: https://code.google.com/p/dart/source/detail?r=18574

Patch Set 1 #

Total comments: 9

Patch Set 2 : Address comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+233 lines, -78 lines) Patch
M sdk/lib/collection/splay_tree.dart View 1 15 chunks +233 lines, -78 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Lasse Reichstein Nielsen
7 years, 10 months ago (2013-02-15 09:37:38 UTC) #1
floitsch
LGTM. I don't really like that the iterator splays his current node to the top, ...
7 years, 10 months ago (2013-02-15 10:04:48 UTC) #2
Lasse Reichstein Nielsen
https://codereview.chromium.org/12260058/diff/1/sdk/lib/collection/splay_tree.dart File sdk/lib/collection/splay_tree.dart (right): https://codereview.chromium.org/12260058/diff/1/sdk/lib/collection/splay_tree.dart#newcode52 sdk/lib/collection/splay_tree.dart:52: * Used to detect that an in-place traversal Finished. ...
7 years, 10 months ago (2013-02-15 13:46:37 UTC) #3
floitsch
7 years, 10 months ago (2013-02-15 13:58:25 UTC) #4
Message was sent while issue was closed.
https://codereview.chromium.org/12260058/diff/1/sdk/lib/collection/splay_tree...
File sdk/lib/collection/splay_tree.dart (right):

https://codereview.chromium.org/12260058/diff/1/sdk/lib/collection/splay_tree...
sdk/lib/collection/splay_tree.dart:264: // TODO(lrn): Do we want to handle the
case where node.value.operator==
On 2013/02/15 13:46:37, Lasse Reichstein Nielsen wrote:
> We have to do the same for compareTo in _splay. That's going to get ugly.
Maybe
> just make _splay non-reentrant.

Let's look at that later.

Powered by Google App Engine
This is Rietveld 408576698