use some more auto (#1146)

This commit is contained in:
Rosen Penev
2023-09-16 04:12:04 -07:00
committed by GitHub
parent 653c2fe9e1
commit bdf50eda99
6 changed files with 10 additions and 13 deletions

View File

@@ -230,8 +230,7 @@ namespace
File* createInternal(FileName fileName, bool readAudioProperties,
AudioProperties::ReadStyle audioPropertiesStyle)
{
File *file = detectByResolvers(fileName, readAudioProperties, audioPropertiesStyle);
if(file)
if(auto file = detectByResolvers(fileName, readAudioProperties, audioPropertiesStyle))
return file;
#ifdef _WIN32
@@ -254,7 +253,7 @@ namespace
return new Ogg::Vorbis::File(fileName, readAudioProperties, audioPropertiesStyle);
if(ext == "OGA") {
/* .oga can be any audio in the Ogg container. First try FLAC, then Vorbis. */
File *file = new Ogg::FLAC::File(fileName, readAudioProperties, audioPropertiesStyle);
auto file = new Ogg::FLAC::File(fileName, readAudioProperties, audioPropertiesStyle);
if(file->isValid())
return file;
delete file;