Tweak GetCpuName code

This commit is contained in:
KeatonTheBot
2026-02-21 14:02:34 -06:00
parent d5bd8871a2
commit 3bf8a17f01
@@ -10,7 +10,7 @@ namespace Ryujinx.UI.Common.SystemInfo
{ {
internal WindowsSystemInfo() internal WindowsSystemInfo()
{ {
CpuName = $"{GetCpuidCpuName() ?? GetCpuName()} ; {LogicalCoreCount} logical"; CpuName = $"{GetCpuidCpuName() ?? GetCpuNameFromRegistry()} ; {LogicalCoreCount} logical";
(RamTotal, RamAvailable) = GetMemoryStats(); (RamTotal, RamAvailable) = GetMemoryStats();
} }
@@ -27,13 +27,6 @@ namespace Ryujinx.UI.Common.SystemInfo
return (0, 0); return (0, 0);
} }
private static string GetCpuName()
{
string cpuName = GetCpuNameFromRegistry();
return !string.IsNullOrEmpty(cpuName) ? cpuName : Environment.GetEnvironmentVariable("PROCESSOR_IDENTIFIER")?.Trim();
}
private static string GetCpuNameFromRegistry() private static string GetCpuNameFromRegistry()
{ {
try try
@@ -46,7 +39,8 @@ namespace Ryujinx.UI.Common.SystemInfo
catch (Exception ex) catch (Exception ex)
{ {
Logger.Error?.Print(LogClass.Application, $"Registry CPU name lookup failed: {ex.Message}"); Logger.Error?.Print(LogClass.Application, $"Registry CPU name lookup failed: {ex.Message}");
return null;
return Environment.GetEnvironmentVariable("PROCESSOR_IDENTIFIER")?.Trim();
} }
} }