]> granicus.if.org Git - taglib/commitdiff
Map::erase() can take a key directly so no need to call find() beforehand.
authorTsuda Kageyu <tsuda.kageyu@gmail.com>
Sat, 23 May 2015 09:12:01 +0000 (18:12 +0900)
committerTsuda Kageyu <tsuda.kageyu@gmail.com>
Sat, 23 May 2015 09:12:01 +0000 (18:12 +0900)
taglib/ape/apetag.cpp
taglib/asf/asftag.cpp

index 22471d40b90e6fa4491c19c4259b37954673e9a6..e0c2a24e0c1cfc24c74b6300d60c5abecc4d40b1 100644 (file)
@@ -284,9 +284,7 @@ const APE::ItemListMap& APE::Tag::itemListMap() const
 
 void APE::Tag::removeItem(const String &key)
 {
-  Map<const String, Item>::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)
index 1389c12201aa905aa7edf399d9c4c92b1c7911b5..bdf3c5dad43caf62ee872dbe0820297c6c9a0561 100644 (file)
@@ -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