diff --git a/src/ARMeilleure/Translation/Cache/JitCache.cs b/src/ARMeilleure/Translation/Cache/JitCache.cs index 0ede558b6..bc75e7d3f 100644 --- a/src/ARMeilleure/Translation/Cache/JitCache.cs +++ b/src/ARMeilleure/Translation/Cache/JitCache.cs @@ -52,7 +52,7 @@ namespace ARMeilleure.Translation.Cache return; } - var firstRegion = new ReservedRegion(allocator, CacheSize); + ReservedRegion firstRegion = new(allocator, CacheSize); _jitRegions.Add(firstRegion); _activeRegionIndex = 0; @@ -124,7 +124,7 @@ namespace ARMeilleure.Translation.Cache { Debug.Assert(_initialized); - foreach (var region in _jitRegions) + foreach (ReservedRegion region in _jitRegions) { if (pointer.ToInt64() < region.Pointer.ToInt64() || pointer.ToInt64() >= (region.Pointer + CacheSize).ToInt64()) @@ -224,7 +224,7 @@ namespace ARMeilleure.Translation.Cache { lock (_lock) { - foreach (var region in _jitRegions) + foreach (ReservedRegion _ in _jitRegions) { int index = _cacheEntries.BinarySearch(new CacheEntry(offset, 0, default)); diff --git a/src/ARMeilleure/Translation/PTC/PtcProfiler.cs b/src/ARMeilleure/Translation/PTC/PtcProfiler.cs index de0b78dbe..f3aaa58ff 100644 --- a/src/ARMeilleure/Translation/PTC/PtcProfiler.cs +++ b/src/ARMeilleure/Translation/PTC/PtcProfiler.cs @@ -144,17 +144,15 @@ namespace ARMeilleure.Translation.PTC public List GetBlacklistedFunctions() { - List funcs = new List(); + List funcs = []; - foreach (var profiledFunc in ProfiledFuncs) + foreach ((ulong ptr, FuncProfile funcProfile) in ProfiledFuncs) { - if (profiledFunc.Value.Blacklist) - { - if (!funcs.Contains(profiledFunc.Key)) - { - funcs.Add(profiledFunc.Key); - } - } + if (!funcProfile.Blacklist) + continue; + + if (!funcs.Contains(ptr)) + funcs.Add(ptr); } return funcs; diff --git a/src/Ryujinx.Cpu/LightningJit/Cache/JitCache.cs b/src/Ryujinx.Cpu/LightningJit/Cache/JitCache.cs index c994d424e..ccf8ad964 100644 --- a/src/Ryujinx.Cpu/LightningJit/Cache/JitCache.cs +++ b/src/Ryujinx.Cpu/LightningJit/Cache/JitCache.cs @@ -48,7 +48,7 @@ namespace Ryujinx.Cpu.LightningJit.Cache return; } - var firstRegion = new ReservedRegion(allocator, CacheSize); + ReservedRegion firstRegion = new(allocator, CacheSize); _jitRegions.Add(firstRegion); _activeRegionIndex = 0; @@ -104,7 +104,7 @@ namespace Ryujinx.Cpu.LightningJit.Cache { Debug.Assert(_initialized); - foreach (var region in _jitRegions) + foreach (ReservedRegion region in _jitRegions) { if (pointer.ToInt64() < region.Pointer.ToInt64() || pointer.ToInt64() >= (region.Pointer + CacheSize).ToInt64()) @@ -160,7 +160,7 @@ namespace Ryujinx.Cpu.LightningJit.Cache } int exhaustedRegion = _activeRegionIndex; - var newRegion = new ReservedRegion(_jitRegions[0].Allocator, CacheSize); + ReservedRegion newRegion = new(_jitRegions[0].Allocator, CacheSize); _jitRegions.Add(newRegion); _activeRegionIndex = _jitRegions.Count - 1; diff --git a/src/Ryujinx/Utilities/PlayReport/Specs.cs b/src/Ryujinx/Utilities/PlayReport/Specs.cs index 5c8126a99..f1b94de68 100644 --- a/src/Ryujinx/Utilities/PlayReport/Specs.cs +++ b/src/Ryujinx/Utilities/PlayReport/Specs.cs @@ -152,7 +152,7 @@ namespace Ryujinx.Ava.Utilities.PlayReport public override bool GetData(Horizon.Prepo.Types.PlayReport playReport, out object result) { List packedObjects = []; - foreach (var reportKey in ReportKeys) + foreach (string reportKey in ReportKeys) { if (!playReport.ReportData.AsDictionary().TryGetValue(reportKey, out MessagePackObject valuePackObject)) { @@ -176,7 +176,7 @@ namespace Ryujinx.Ava.Utilities.PlayReport public override bool GetData(Horizon.Prepo.Types.PlayReport playReport, out object result) { Dictionary packedObjects = []; - foreach (var reportKey in ReportKeys) + foreach (string reportKey in ReportKeys) { if (!playReport.ReportData.AsDictionary().TryGetValue(reportKey, out MessagePackObject valuePackObject)) continue;