ISOFile/GameFile: Simplify IsElfOrDol

This commit is contained in:
JosJuice
2015-11-15 18:04:45 +01:00
parent f33a9ed439
commit 4249d9ef77
2 changed files with 7 additions and 19 deletions

View File

@ -243,17 +243,8 @@ void GameFile::SaveToCache()
bool GameFile::IsElfOrDol() const
{
const std::string name = m_file_name.toStdString();
const size_t pos = name.rfind('.');
if (pos != std::string::npos)
{
std::string ext = name.substr(pos);
std::transform(ext.begin(), ext.end(), ext.begin(), ::tolower);
return ext == ".elf" || ext == ".dol";
}
return false;
return m_file_name.endsWith(QStringLiteral(".elf"), Qt::CaseInsensitive) ||
m_file_name.endsWith(QStringLiteral(".dol"), Qt::CaseInsensitive);
}
QString GameFile::CreateCacheFilename() const