From 32b4e9d13696cba2215de7bd232e0e409fadff57 Mon Sep 17 00:00:00 2001 From: TSR Berry <20988865+TSRBerry@users.noreply.github.com> Date: Sun, 28 Jul 2024 21:05:10 +0200 Subject: [PATCH] optimization: Avoid enumerating applications multiple times --- src/Ryujinx.UI.Common/App/ApplicationLibrary.cs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/Ryujinx.UI.Common/App/ApplicationLibrary.cs b/src/Ryujinx.UI.Common/App/ApplicationLibrary.cs index 2defc1f6c8..89d2326c37 100644 --- a/src/Ryujinx.UI.Common/App/ApplicationLibrary.cs +++ b/src/Ryujinx.UI.Common/App/ApplicationLibrary.cs @@ -576,19 +576,13 @@ namespace Ryujinx.UI.App.Common { AppData = application, }); - } - if (applications.Count > 1) - { - numApplicationsFound += applications.Count - 1; + numApplicationsFound++; + numApplicationsLoaded++; } + } - numApplicationsLoaded += applications.Count; - } - else - { - numApplicationsFound--; - } + numApplicationsFound--; OnApplicationCountUpdated(new ApplicationCountUpdatedEventArgs {