diff options
| author | JosJuice <josjuice@gmail.com> | 2015-11-15 18:04:45 +0100 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2015-11-27 10:50:19 +0100 |
| commit | 4249d9ef773a027d13630044522579af582dbdba (patch) | |
| tree | 61f1371663dbf2fb5fdf1ac1edb73d2fff2fb02c /Source/Core/DolphinQt/GameList/GameFile.cpp | |
| parent | f33a9ed439ee133f88ca12b6954177bddc8ecc04 (diff) | |
ISOFile/GameFile: Simplify IsElfOrDol
Diffstat (limited to 'Source/Core/DolphinQt/GameList/GameFile.cpp')
| -rw-r--r-- | Source/Core/DolphinQt/GameList/GameFile.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/Source/Core/DolphinQt/GameList/GameFile.cpp b/Source/Core/DolphinQt/GameList/GameFile.cpp index 4cc6b9a328..44c68ffd8d 100644 --- a/Source/Core/DolphinQt/GameList/GameFile.cpp +++ b/Source/Core/DolphinQt/GameList/GameFile.cpp @@ -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 |
