Skip to content

Commit f1dcdaa

Browse files
authored
[libc++] Refactor remaining __find_equal calls (#156594)
#147345 refactored `__find_equal`. Unfortunately there was a merge conflict with another patch. This fixes up the problematic places.
1 parent 22e7c36 commit f1dcdaa

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

libcxx/include/__tree

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,8 +1046,7 @@ public:
10461046
static_cast<__node_base_pointer>(__nd.get()));
10471047
__max_node = __nd.release();
10481048
} else {
1049-
__end_node_pointer __parent;
1050-
__node_base_pointer& __child = __find_equal(__parent, __key);
1049+
auto [__parent, __child] = __find_equal(__key);
10511050
if (__child == nullptr) {
10521051
__node_holder __nd = __construct_node(std::forward<__reference>(__val));
10531052
__insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__nd.release()));
@@ -1062,8 +1061,7 @@ public:
10621061
static_cast<__node_base_pointer>(__nd.get()));
10631062
__max_node = __nd.release();
10641063
} else {
1065-
__end_node_pointer __parent;
1066-
__node_base_pointer& __child = __find_equal(__parent, __nd->__get_value());
1064+
auto [__parent, __child] = __find_equal(__nd->__get_value());
10671065
if (__child == nullptr) {
10681066
__insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__nd.release()));
10691067
}

0 commit comments

Comments
 (0)