mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 12:24:24 +00:00
Fix the migrated splay_tree.dart to make some casts nullable.
I think the covers the cases where it seems reasonable for the value being cast to be null. In the other places where I see casts, it's pretty clear that a null is an error. Change-Id: I38e9b47da72579e7f3849284689d4c25b5b14af1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136725 Auto-Submit: Bob Nystrom <rnystrom@google.com> Reviewed-by: Leaf Petersen <leafp@google.com> Commit-Queue: Bob Nystrom <rnystrom@google.com>
This commit is contained in:
parent
9bedc9a7af
commit
6ef9131d82
1 changed files with 3 additions and 3 deletions
|
@ -166,9 +166,9 @@ abstract class _SplayTree<K, Node extends _SplayTreeNode<K>> {
|
|||
_count--;
|
||||
// assert(_count >= 0);
|
||||
if (_root!.left == null) {
|
||||
_root = _root!.right as Node;
|
||||
_root = _root!.right as Node?;
|
||||
} else {
|
||||
Node right = _root!.right as Node;
|
||||
Node? right = _root!.right as Node?;
|
||||
// Splay to make sure that the new root has an empty right child.
|
||||
_root = _splayMax(_root!.left as Node);
|
||||
// Insert the original right child as the right child of the new
|
||||
|
@ -429,7 +429,7 @@ class SplayTreeMap<K, V> extends _SplayTree<K, _SplayTreeMapNode<K, V>>
|
|||
if (node.right != null && visit(node.right as _SplayTreeMapNode)) {
|
||||
return true;
|
||||
}
|
||||
node = node.left as _SplayTreeMapNode;
|
||||
node = node.left as _SplayTreeMapNode?;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue