Merge pull request #569 from TsudaKageyu/map-erase

std::map::erase() can take a key directly and has no-throw guarantee.
This commit is contained in:
Stephen F. Booth 2015-05-21 22:46:15 -04:00
commit 0ea22348cb

View File

@ -145,9 +145,7 @@ template <class Key, class T>
Map<Key, T> &Map<Key,T>::erase(const Key &key)
{
detach();
Iterator it = d->map.find(key);
if(it != d->map.end())
d->map.erase(it);
d->map.erase(key);
return *this;
}