mirror of
https://github.com/taglib/taglib.git
synced 2025-07-14 02:54:27 -04:00
Avoid unnecessary detaching of containers
If only a constant iterator is needed, make the container const if possible, otherwise use cbegin() and cend() to get a constant iterator without detaching the container. These fixes are needed so that `auto` can deduce the correct iterator type.
This commit is contained in:
@ -259,7 +259,7 @@ void taglib_tag_free_strings()
|
||||
if(!stringManagementEnabled)
|
||||
return;
|
||||
|
||||
for(List<char *>::ConstIterator it = strings.begin(); it != strings.end(); ++it)
|
||||
for(List<char *>::ConstIterator it = strings.cbegin(); it != strings.cend(); ++it)
|
||||
free(*it);
|
||||
strings.clear();
|
||||
}
|
||||
|
Reference in New Issue
Block a user