@@ -402,14 +402,14 @@ public struct RedBlackTree<Key: Comparable, Value>: Probable, Collection, Custom
402
402
while x !== sentinel {
403
403
y = x
404
404
y. order += 1
405
- x = key < x. key ? x. left : x. right
405
+ x = key < x. key as Key ? x. left : x. right
406
406
}
407
407
408
408
let z = RedBlackNode < Key , Value > ( parent: y, sentinel: sentinel, key: key, value: value)
409
409
410
410
if y == sentinel {
411
411
root = z
412
- } else if key < y. key {
412
+ } else if key < y. key as Key {
413
413
y. left = z
414
414
} else {
415
415
y. right = z
@@ -694,7 +694,7 @@ public struct RedBlackTree<Key: Comparable, Value>: Probable, Collection, Custom
694
694
if key == z. key {
695
695
return z
696
696
}
697
- z = key < z. key ? z. left : z. right
697
+ z = key < z. key as Key ? z. left : z. right
698
698
}
699
699
return sentinel
700
700
}
@@ -788,27 +788,27 @@ public func !=<Key : Comparable, Value>(lhs: RedBlackTree<Key, Value>, rhs: RedB
788
788
public func + < Key : Comparable , Value> ( lhs: RedBlackTree < Key , Value > , rhs: RedBlackTree < Key , Value > ) -> RedBlackTree < Key , Value > {
789
789
var t = lhs
790
790
for (k, v) in rhs {
791
- t. insert ( k , value: v)
791
+ t. insert ( value: v, for : k )
792
792
}
793
793
return t
794
794
}
795
795
796
796
public func += < Key : Comparable , Value> ( lhs: inout RedBlackTree < Key , Value > , rhs: RedBlackTree < Key , Value > ) {
797
797
for (k, v) in rhs {
798
- lhs. insert ( k , value: v)
798
+ lhs. insert ( value: v, for : k )
799
799
}
800
800
}
801
801
802
802
public func - < Key : Comparable , Value> ( lhs: RedBlackTree < Key , Value > , rhs: RedBlackTree < Key , Value > ) -> RedBlackTree < Key , Value > {
803
803
var t = rhs
804
804
for (k, _) in rhs {
805
- t . removeValueForKeys ( k)
805
+ t . removeValue ( for : k)
806
806
}
807
807
return t
808
808
}
809
809
810
810
public func -= < Key : Comparable , Value> ( lhs: inout RedBlackTree < Key , Value > , rhs: RedBlackTree < Key , Value > ) {
811
811
for (k, _) in rhs {
812
- lhs. removeValueForKeys ( k)
812
+ lhs. removeValue ( for : k)
813
813
}
814
814
}
0 commit comments