diff --git a/src/move/research/red_black_map/sources/red_black_map.move b/src/move/research/red_black_map/sources/red_black_map.move index 3771848..2df1185 100644 --- a/src/move/research/red_black_map/sources/red_black_map.move +++ b/src/move/research/red_black_map/sources/red_black_map.move @@ -47,14 +47,9 @@ module econia::red_black_map { Map { root: Pointer::Null, nodes: vector::empty() } } - /* - public fun contains(self: &Map, key: u256): bool { - match (self.search(key)) { - Found { node: _, side_as_child: _ } => true, - NotFound { prospective_parent: _, prospective_side_as_child: _ } => false - } - } - */ + public fun contains(self: &Map, key: u256): bool { + if (self.search(key) is SearchResult::Found) true else false + } public fun insert(self: &mut Map, key: u256, value: V) { match(self.root) {