mirror of
https://github.com/taglib/taglib.git
synced 2026-06-14 02:09:27 -04:00
Narrow the scope of iterators
Also make sure that it is visible at first glance that iterators are not taken from temporaries.
This commit is contained in:
@@ -74,8 +74,7 @@ namespace
|
||||
if(::strlen(fileName) == 0)
|
||||
return nullptr;
|
||||
#endif
|
||||
auto it = fileTypeResolvers.cbegin();
|
||||
for(; it != fileTypeResolvers.cend(); ++it) {
|
||||
for(auto it = fileTypeResolvers.cbegin(); it != fileTypeResolvers.cend(); ++it) {
|
||||
File *file = (*it)->createFile(fileName, readAudioProperties, audioPropertiesStyle);
|
||||
if(file)
|
||||
return file;
|
||||
@@ -87,10 +86,8 @@ namespace
|
||||
File *detectByResolvers(IOStream* stream, bool readAudioProperties,
|
||||
AudioProperties::ReadStyle audioPropertiesStyle)
|
||||
{
|
||||
for(auto it = fileTypeResolvers.cbegin();
|
||||
it != fileTypeResolvers.cend(); ++it) {
|
||||
if(auto streamResolver =
|
||||
dynamic_cast<const FileRef::StreamTypeResolver*>(*it)) {
|
||||
for(auto it = fileTypeResolvers.cbegin(); it != fileTypeResolvers.cend(); ++it) {
|
||||
if(auto streamResolver = dynamic_cast<const FileRef::StreamTypeResolver*>(*it)) {
|
||||
if(File *file = streamResolver->createFileFromStream(
|
||||
stream, readAudioProperties, audioPropertiesStyle))
|
||||
return file;
|
||||
|
||||
Reference in New Issue
Block a user