Merge pull request #572 from TsudaKageyu/map-erase2

Map::erase() can take a key directly so no need to call find() before…
This commit is contained in:
Stephen F. Booth 2015-05-23 08:21:58 -04:00
commit 4129b919c1
2 changed files with 2 additions and 6 deletions

View 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)

View 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