diff --git a/include/boost/unordered/unordered_map.hpp b/include/boost/unordered/unordered_map.hpp index 02fe1f9f..97908fb6 100644 --- a/include/boost/unordered/unordered_map.hpp +++ b/include/boost/unordered/unordered_map.hpp @@ -1856,18 +1856,14 @@ namespace boost { typename unordered_map::iterator unordered_map::erase(iterator position) { - const_iterator last = position; - ++last; - return table_.erase_nodes_range(position, last); + return table_.erase_node(position); } template typename unordered_map::iterator unordered_map::erase(const_iterator position) { - const_iterator last = position; - ++last; - return table_.erase_nodes_range(position, last); + return table_.erase_node(position); } template @@ -2340,9 +2336,7 @@ namespace boost { unordered_multimap::erase(iterator position) { BOOST_ASSERT(position != this->end()); - iterator next = position; - ++next; - return table_.erase_nodes_range(position, next); + return table_.erase_node(position); } template @@ -2350,9 +2344,7 @@ namespace boost { unordered_multimap::erase(const_iterator position) { BOOST_ASSERT(position != this->end()); - const_iterator next = position; - ++next; - return table_.erase_nodes_range(position, next); + return table_.erase_node(position); } template diff --git a/include/boost/unordered/unordered_set.hpp b/include/boost/unordered/unordered_set.hpp index d1ddc347..8721a68a 100644 --- a/include/boost/unordered/unordered_set.hpp +++ b/include/boost/unordered/unordered_set.hpp @@ -1457,9 +1457,7 @@ namespace boost { typename unordered_set::iterator unordered_set::erase(const_iterator position) { - const_iterator last = position; - ++last; - return table_.erase_nodes_range(position, last); + return table_.erase_node(position); } template @@ -1853,10 +1851,7 @@ namespace boost { unordered_multiset::erase(const_iterator position) { BOOST_ASSERT(position != this->end()); - iterator next = position; - ++next; - table_.erase_nodes_range(position, next); - return next; + return table_.erase_node(position); } template