misc: chore: [ci skip] Use explicit types & target-typed new

This commit is contained in:
Evan Husted 2025-02-10 16:44:18 -06:00
parent faacec9801
commit 6ab899f621
4 changed files with 15 additions and 17 deletions

View file

@ -52,7 +52,7 @@ namespace ARMeilleure.Translation.Cache
return; return;
} }
var firstRegion = new ReservedRegion(allocator, CacheSize); ReservedRegion firstRegion = new(allocator, CacheSize);
_jitRegions.Add(firstRegion); _jitRegions.Add(firstRegion);
_activeRegionIndex = 0; _activeRegionIndex = 0;
@ -124,7 +124,7 @@ namespace ARMeilleure.Translation.Cache
{ {
Debug.Assert(_initialized); Debug.Assert(_initialized);
foreach (var region in _jitRegions) foreach (ReservedRegion region in _jitRegions)
{ {
if (pointer.ToInt64() < region.Pointer.ToInt64() || if (pointer.ToInt64() < region.Pointer.ToInt64() ||
pointer.ToInt64() >= (region.Pointer + CacheSize).ToInt64()) pointer.ToInt64() >= (region.Pointer + CacheSize).ToInt64())
@ -224,7 +224,7 @@ namespace ARMeilleure.Translation.Cache
{ {
lock (_lock) lock (_lock)
{ {
foreach (var region in _jitRegions) foreach (ReservedRegion _ in _jitRegions)
{ {
int index = _cacheEntries.BinarySearch(new CacheEntry(offset, 0, default)); int index = _cacheEntries.BinarySearch(new CacheEntry(offset, 0, default));

View file

@ -144,17 +144,15 @@ namespace ARMeilleure.Translation.PTC
public List<ulong> GetBlacklistedFunctions() public List<ulong> GetBlacklistedFunctions()
{ {
List<ulong> funcs = new List<ulong>(); List<ulong> funcs = [];
foreach (var profiledFunc in ProfiledFuncs) foreach ((ulong ptr, FuncProfile funcProfile) in ProfiledFuncs)
{ {
if (profiledFunc.Value.Blacklist) if (!funcProfile.Blacklist)
{ continue;
if (!funcs.Contains(profiledFunc.Key))
{ if (!funcs.Contains(ptr))
funcs.Add(profiledFunc.Key); funcs.Add(ptr);
}
}
} }
return funcs; return funcs;

View file

@ -48,7 +48,7 @@ namespace Ryujinx.Cpu.LightningJit.Cache
return; return;
} }
var firstRegion = new ReservedRegion(allocator, CacheSize); ReservedRegion firstRegion = new(allocator, CacheSize);
_jitRegions.Add(firstRegion); _jitRegions.Add(firstRegion);
_activeRegionIndex = 0; _activeRegionIndex = 0;
@ -104,7 +104,7 @@ namespace Ryujinx.Cpu.LightningJit.Cache
{ {
Debug.Assert(_initialized); Debug.Assert(_initialized);
foreach (var region in _jitRegions) foreach (ReservedRegion region in _jitRegions)
{ {
if (pointer.ToInt64() < region.Pointer.ToInt64() || if (pointer.ToInt64() < region.Pointer.ToInt64() ||
pointer.ToInt64() >= (region.Pointer + CacheSize).ToInt64()) pointer.ToInt64() >= (region.Pointer + CacheSize).ToInt64())
@ -160,7 +160,7 @@ namespace Ryujinx.Cpu.LightningJit.Cache
} }
int exhaustedRegion = _activeRegionIndex; int exhaustedRegion = _activeRegionIndex;
var newRegion = new ReservedRegion(_jitRegions[0].Allocator, CacheSize); ReservedRegion newRegion = new(_jitRegions[0].Allocator, CacheSize);
_jitRegions.Add(newRegion); _jitRegions.Add(newRegion);
_activeRegionIndex = _jitRegions.Count - 1; _activeRegionIndex = _jitRegions.Count - 1;

View file

@ -152,7 +152,7 @@ namespace Ryujinx.Ava.Utilities.PlayReport
public override bool GetData(Horizon.Prepo.Types.PlayReport playReport, out object result) public override bool GetData(Horizon.Prepo.Types.PlayReport playReport, out object result)
{ {
List<MessagePackObject> packedObjects = []; List<MessagePackObject> packedObjects = [];
foreach (var reportKey in ReportKeys) foreach (string reportKey in ReportKeys)
{ {
if (!playReport.ReportData.AsDictionary().TryGetValue(reportKey, out MessagePackObject valuePackObject)) 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) public override bool GetData(Horizon.Prepo.Types.PlayReport playReport, out object result)
{ {
Dictionary<string, MessagePackObject> packedObjects = []; Dictionary<string, MessagePackObject> packedObjects = [];
foreach (var reportKey in ReportKeys) foreach (string reportKey in ReportKeys)
{ {
if (!playReport.ReportData.AsDictionary().TryGetValue(reportKey, out MessagePackObject valuePackObject)) if (!playReport.ReportData.AsDictionary().TryGetValue(reportKey, out MessagePackObject valuePackObject))
continue; continue;