@@ -402,14 +402,14 @@ public struct RedBlackTree<Key: Comparable, Value>: Probable, Collection, Custom
402402 while x !== sentinel {
403403 y = x
404404 y. order += 1
405- x = key < x. key ? x. left : x. right
405+ x = key < x. key as Key ? x. left : x. right
406406 }
407407
408408 let z = RedBlackNode < Key , Value > ( parent: y, sentinel: sentinel, key: key, value: value)
409409
410410 if y == sentinel {
411411 root = z
412- } else if key < y. key {
412+ } else if key < y. key as Key {
413413 y. left = z
414414 } else {
415415 y. right = z
@@ -694,7 +694,7 @@ public struct RedBlackTree<Key: Comparable, Value>: Probable, Collection, Custom
694694 if key == z. key {
695695 return z
696696 }
697- z = key < z. key ? z. left : z. right
697+ z = key < z. key as Key ? z. left : z. right
698698 }
699699 return sentinel
700700 }
@@ -788,27 +788,27 @@ public func !=<Key : Comparable, Value>(lhs: RedBlackTree<Key, Value>, rhs: RedB
788788public func + < Key : Comparable , Value> ( lhs: RedBlackTree < Key , Value > , rhs: RedBlackTree < Key , Value > ) -> RedBlackTree < Key , Value > {
789789 var t = lhs
790790 for (k, v) in rhs {
791- t. insert ( k , value: v)
791+ t. insert ( value: v, for : k )
792792 }
793793 return t
794794}
795795
796796public func += < Key : Comparable , Value> ( lhs: inout RedBlackTree < Key , Value > , rhs: RedBlackTree < Key , Value > ) {
797797 for (k, v) in rhs {
798- lhs. insert ( k , value: v)
798+ lhs. insert ( value: v, for : k )
799799 }
800800}
801801
802802public func - < Key : Comparable , Value> ( lhs: RedBlackTree < Key , Value > , rhs: RedBlackTree < Key , Value > ) -> RedBlackTree < Key , Value > {
803803 var t = rhs
804804 for (k, _) in rhs {
805- t . removeValueForKeys ( k)
805+ t . removeValue ( for : k)
806806 }
807807 return t
808808}
809809
810810public func -= < Key : Comparable , Value> ( lhs: inout RedBlackTree < Key , Value > , rhs: RedBlackTree < Key , Value > ) {
811811 for (k, _) in rhs {
812- lhs. removeValueForKeys ( k)
812+ lhs. removeValue ( for : k)
813813 }
814814}
0 commit comments