mirror of
https://github.com/taglib/taglib.git
synced 2025-05-27 21:20:26 -04:00
The non-const functions here should call detach.
git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@572630 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
parent
545c9ebeb7
commit
71a392fe81
@ -106,6 +106,7 @@ bool Map<Key, T>::isEmpty() const
|
||||
template <class Key, class T>
|
||||
typename Map<Key, T>::Iterator Map<Key, T>::find(const Key &key)
|
||||
{
|
||||
detach();
|
||||
return d->map.find(key);
|
||||
}
|
||||
|
||||
@ -124,6 +125,7 @@ bool Map<Key, T>::contains(const Key &key) const
|
||||
template <class Key, class T>
|
||||
Map<Key, T> &Map<Key,T>::erase(Iterator it)
|
||||
{
|
||||
detach();
|
||||
d->map.erase(it);
|
||||
return *this;
|
||||
}
|
||||
@ -143,7 +145,8 @@ const T &Map<Key, T>::operator[](const Key &key) const
|
||||
template <class Key, class T>
|
||||
T &Map<Key, T>::operator[](const Key &key)
|
||||
{
|
||||
return d->map[key];
|
||||
detach();
|
||||
return d->map[key];
|
||||
}
|
||||
|
||||
template <class Key, class T>
|
||||
|
Loading…
Reference in New Issue
Block a user