yuzu/game_list_worker: Don't retrieve file type and file type strings twice in MakeGameListEntry()
While GetFileType() is indeed a getter function, that doesn't mean it's a trivial function, given some case require reading from the data or constructing other objects in the background. Instead, only do necessary work once.
This commit is contained in:
parent
de323851b4
commit
de095ded5c
1 changed files with 6 additions and 4 deletions
|
@ -99,12 +99,14 @@ QList<QStandardItem*> MakeGameListEntry(const std::string& path, const std::stri
|
|||
compatibility = it->second.first;
|
||||
}
|
||||
|
||||
const auto file_type = loader.GetFileType();
|
||||
const auto file_type_string = QString::fromStdString(Loader::GetFileTypeString(file_type));
|
||||
|
||||
QList<QStandardItem*> list{
|
||||
new GameListItemPath(
|
||||
FormatGameName(path), icon, QString::fromStdString(name),
|
||||
QString::fromStdString(Loader::GetFileTypeString(loader.GetFileType())), program_id),
|
||||
new GameListItemPath(FormatGameName(path), icon, QString::fromStdString(name),
|
||||
file_type_string, program_id),
|
||||
new GameListItemCompat(compatibility),
|
||||
new GameListItem(QString::fromStdString(Loader::GetFileTypeString(loader.GetFileType()))),
|
||||
new GameListItem(file_type_string),
|
||||
new GameListItemSize(FileUtil::GetSize(path)),
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue