From: Tsuda Kageyu Date: Sat, 23 May 2015 09:12:01 +0000 (+0900) Subject: Map::erase() can take a key directly so no need to call find() beforehand. X-Git-Tag: v1.10beta~74^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6d6f5440104ed34ef324ac1e28ecf531bda15d0a;p=taglib Map::erase() can take a key directly so no need to call find() beforehand. --- diff --git a/taglib/ape/apetag.cpp b/taglib/ape/apetag.cpp index 22471d40..e0c2a24e 100644 --- a/taglib/ape/apetag.cpp +++ b/taglib/ape/apetag.cpp @@ -284,9 +284,7 @@ const APE::ItemListMap& APE::Tag::itemListMap() const void APE::Tag::removeItem(const String &key) { - Map::Iterator it = d->itemListMap.find(key.upper()); - if(it != d->itemListMap.end()) - d->itemListMap.erase(it); + d->itemListMap.erase(key.upper()); } void APE::Tag::addValue(const String &key, const String &value, bool replace) diff --git a/taglib/asf/asftag.cpp b/taglib/asf/asftag.cpp index 1389c122..bdf3c5da 100644 --- a/taglib/asf/asftag.cpp +++ b/taglib/asf/asftag.cpp @@ -172,9 +172,7 @@ bool ASF::Tag::contains(const String &key) const void ASF::Tag::removeItem(const String &key) { - AttributeListMap::Iterator it = d->attributeListMap.find(key); - if(it != d->attributeListMap.end()) - d->attributeListMap.erase(it); + d->attributeListMap.erase(key); } ASF::AttributeList ASF::Tag::attribute(const String &name) const