Fix CA1859: Use concrete types when possible for improved performance

This commit is contained in:
Haselnussbomber 2025-10-24 03:20:47 +02:00
parent 7d94098ba3
commit 1d8bd96e86
No known key found for this signature in database
GPG key ID: BB905BB49E7295D1
5 changed files with 7 additions and 8 deletions

View file

@ -33,7 +33,7 @@ namespace Dalamud.Game.Network.Internal;
[ServiceManager.EarlyLoadedService]
internal unsafe class NetworkHandlers : IInternalDisposableService
{
private readonly IMarketBoardUploader uploader;
private readonly UniversalisMarketBoardUploader uploader;
private readonly IDisposable handleMarketBoardItemRequest;
private readonly IDisposable handleMarketTaxRates;
@ -448,7 +448,7 @@ internal unsafe class NetworkHandlers : IInternalDisposableService
private void UploadMarketBoardData(
MarketBoardItemRequest request,
(uint CatalogId, ICollection<MarketBoardHistory.MarketBoardHistoryListing> Sales) sales,
ICollection<MarketBoardCurrentOfferings.MarketBoardItemListing> listings,
List<MarketBoardCurrentOfferings.MarketBoardItemListing> listings,
ulong uploaderId,
uint worldId)
{

View file

@ -213,11 +213,10 @@ public abstract partial class Payload
return payload;
}
private static Payload DecodeText(BinaryReader reader)
private static TextPayload DecodeText(BinaryReader reader)
{
var payload = new TextPayload();
payload.DecodeImpl(reader, reader.BaseStream.Length);
return payload;
}
}

View file

@ -117,7 +117,7 @@ public sealed class SystemFontFamilyId : IFontFamilyId
return new(IObjectWithLocalizableName.GetLocaleNames(fn));
}
private unsafe IReadOnlyList<IFontId> GetFonts()
private unsafe List<IFontId> GetFonts()
{
using var dwf = default(ComPtr<IDWriteFactory>);
fixed (Guid* piid = &IID.IID_IDWriteFactory)

View file

@ -1235,7 +1235,7 @@ public sealed class SingleFontChooserDialog : IDisposable
}
private void UpdateSelectedFamilyAndFontIndices(
IReadOnlyList<IFontFamilyId> fonts,
List<IFontFamilyId> fonts,
string familyName,
string fontName)
{

View file

@ -193,8 +193,8 @@ public static partial class ImRaii
return new EndUnconditionally(Restore, true);
}
private static IEndObject DisabledEnd()
=> new EndUnconditionally(() =>
private static EndUnconditionally DisabledEnd()
=> new(() =>
{
--disabledCount;
ImGui.EndDisabled();