mirror of
https://github.com/starr-dusT/yuzu-mainline
synced 2024-03-05 21:12:25 -08:00
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
@ -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 New Issue
Block a user