@@ -32,23 +32,23 @@ internal class RedBlackNode<Key: Comparable, Value>: Comparable, Equatable, Cust
3232 /**
3333 :name: parent
3434 :description: A reference to the parent node of a given node.
35- - returns: RedBlackNode<Key, Value> !
35+ - returns: RedBlackNode!
3636 */
37- internal var parent : RedBlackNode < Key , Value > !
37+ internal var parent : RedBlackNode !
3838
3939 /**
4040 :name: left
4141 :description: A reference to the left child node of a given node.
42- - returns: RedBlackNode<Key, Value> !
42+ - returns: RedBlackNode!
4343 */
44- internal var left : RedBlackNode < Key , Value > !
44+ internal var left : RedBlackNode !
4545
4646 /**
4747 :name: right
4848 :description: A reference to the right child node of a given node.
49- - returns: RedBlackNode<Key, Value> !
49+ - returns: RedBlackNode!
5050 */
51- internal var right : RedBlackNode < Key , Value > !
51+ internal var right : RedBlackNode !
5252
5353 /**
5454 :name: isRed
@@ -102,7 +102,7 @@ internal class RedBlackNode<Key: Comparable, Value>: Comparable, Equatable, Cust
102102 :name: init
103103 :description: Constructor used for nodes that store data.
104104 */
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 ? ) {
106106 self . key = key
107107 self . value = value
108108 self . parent = parent
@@ -111,24 +111,14 @@ internal class RedBlackNode<Key: Comparable, Value>: Comparable, Equatable, Cust
111111 isRed = true
112112 order = 1
113113 }
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+ }
114122}
115123
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- }
131124
132- func <<Key : Comparable, Value> ( lhs: RedBlackNode < Key , Value > , rhs: RedBlackNode < Key , Value > ) -> Bool {
133- return lhs. key < rhs. key
134- }
0 commit comments