@@ -32,23 +32,23 @@ internal class RedBlackNode<Key: Comparable, Value>: Comparable, Equatable, Cust
32
32
/**
33
33
:name: parent
34
34
:description: A reference to the parent node of a given node.
35
- - returns: RedBlackNode<Key, Value> !
35
+ - returns: RedBlackNode!
36
36
*/
37
- internal var parent : RedBlackNode < Key , Value > !
37
+ internal var parent : RedBlackNode !
38
38
39
39
/**
40
40
:name: left
41
41
:description: A reference to the left child node of a given node.
42
- - returns: RedBlackNode<Key, Value> !
42
+ - returns: RedBlackNode!
43
43
*/
44
- internal var left : RedBlackNode < Key , Value > !
44
+ internal var left : RedBlackNode !
45
45
46
46
/**
47
47
:name: right
48
48
:description: A reference to the right child node of a given node.
49
- - returns: RedBlackNode<Key, Value> !
49
+ - returns: RedBlackNode!
50
50
*/
51
- internal var right : RedBlackNode < Key , Value > !
51
+ internal var right : RedBlackNode !
52
52
53
53
/**
54
54
:name: isRed
@@ -102,7 +102,7 @@ internal class RedBlackNode<Key: Comparable, Value>: Comparable, Equatable, Cust
102
102
:name: init
103
103
:description: Constructor used for nodes that store data.
104
104
*/
105
- internal init ( parent: RedBlackNode < Key , Value > , sentinel: RedBlackNode < Key , Value > , key: Key , value: Value ? ) {
105
+ internal init ( parent: RedBlackNode , sentinel: RedBlackNode , key: Key , value: Value ? ) {
106
106
self . key = key
107
107
self . value = value
108
108
self . parent = parent
@@ -111,24 +111,14 @@ internal class RedBlackNode<Key: Comparable, Value>: Comparable, Equatable, Cust
111
111
isRed = true
112
112
order = 1
113
113
}
114
+
115
+ static func == ( lhs: RedBlackNode , rhs: RedBlackNode ) -> Bool {
116
+ return lhs. key == rhs. key
117
+ }
118
+
119
+ static func < ( lhs: RedBlackNode , rhs: RedBlackNode ) -> Bool {
120
+ return lhs. key < rhs. key
121
+ }
114
122
}
115
123
116
- func == < Key : Comparable , Value> ( lhs: RedBlackNode < Key , Value > , rhs: RedBlackNode < Key , Value > ) -> Bool {
117
- return lhs. key == rhs. key
118
- }
119
-
120
- func <= < Key : Comparable , Value> ( lhs: RedBlackNode < Key , Value > , rhs: RedBlackNode < Key , Value > ) -> Bool {
121
- return lhs. key <= rhs. key
122
- }
123
-
124
- func >= < Key : Comparable , Value> ( lhs: RedBlackNode < Key , Value > , rhs: RedBlackNode < Key , Value > ) -> Bool {
125
- return lhs. key >= rhs. key
126
- }
127
-
128
- func > < Key : Comparable , Value> ( lhs: RedBlackNode < Key , Value > , rhs: RedBlackNode < Key , Value > ) -> Bool {
129
- return lhs. key > rhs. key
130
- }
131
124
132
- func <<Key : Comparable, Value> ( lhs: RedBlackNode < Key , Value > , rhs: RedBlackNode < Key , Value > ) -> Bool {
133
- return lhs. key < rhs. key
134
- }
0 commit comments