correct map insert to use _comp, add tests iterators in swap, and add correction screenshot
This commit is contained in:
@@ -152,9 +152,9 @@ MP_TPL pair<typename MP::iterator, bool> MP::
|
||||
if (value.first == n->value.first)
|
||||
return ft::make_pair(iterator(n, _sentinel), false);
|
||||
n = next;
|
||||
if (value.first < n->value.first)
|
||||
if (_comp(value.first, n->value.first))
|
||||
next = n->left;
|
||||
else if (value.first > n->value.first)
|
||||
else if (_comp(n->value.first, value.first))
|
||||
next = n->right;
|
||||
}
|
||||
|
||||
@@ -168,9 +168,9 @@ MP_TPL pair<typename MP::iterator, bool> MP::
|
||||
}
|
||||
else
|
||||
{
|
||||
if (value.first < n->value.first)
|
||||
if (_comp(value.first, n->value.first))
|
||||
n->left = next;
|
||||
else if (value.first > n->value.first)
|
||||
else if (_comp(n->value.first, value.first))
|
||||
n->right = next;
|
||||
}
|
||||
next->up = n;
|
||||
|
||||
Reference in New Issue
Block a user