From 54de66f2751d2d870815ec60ef4e9696ca13e34d Mon Sep 17 00:00:00 2001 From: Tsuda Kageyu Date: Fri, 22 May 2015 01:26:56 +0900 Subject: [PATCH] std::map::erase() can take a key directly and has no-throw guarantee. --- taglib/toolkit/tmap.tcc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/taglib/toolkit/tmap.tcc b/taglib/toolkit/tmap.tcc index 5d3abcad..8c1106df 100644 --- a/taglib/toolkit/tmap.tcc +++ b/taglib/toolkit/tmap.tcc @@ -145,9 +145,7 @@ template Map &Map::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; }