simplify; this is a map, not a multimap
This commit is contained in:
Glenn Maynard
2006-10-06 06:44:33 +00:00
parent fc2ddf5d3d
commit 9826c3c298
+7 -6
View File
@@ -135,12 +135,13 @@ bool XNode::RemoveChild( XNode *node, bool bDelete )
// detach attribute
bool XNode::RemoveAttr( const RString &sName )
{
XAttrs::iterator begin = m_attrs.lower_bound( sName );
XAttrs::iterator end = m_attrs.upper_bound( sName );
if( begin == end )
return false;
m_attrs.erase( begin, end );
return true;
XAttrs::iterator it = m_attrs.find( sName );
if( it == m_attrs.end() )
return false;
delete it->second;
m_attrs.erase( it );
return true;
}
/* If bOverwrite is true and a node already exists with that name, the old value will be deleted.