From 1d8bd96e86b11d31e9f9dbb063c48eee9e096787 Mon Sep 17 00:00:00 2001 From: Haselnussbomber Date: Fri, 24 Oct 2025 03:20:47 +0200 Subject: [PATCH] Fix CA1859: Use concrete types when possible for improved performance --- Dalamud/Game/Network/Internal/NetworkHandlers.cs | 4 ++-- Dalamud/Game/Text/SeStringHandling/Payload.cs | 3 +-- Dalamud/Interface/FontIdentifier/SystemFontFamilyId.cs | 2 +- .../ImGuiFontChooserDialog/SingleFontChooserDialog.cs | 2 +- Dalamud/Interface/Utility/Raii/EndObjects.cs | 4 ++-- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Dalamud/Game/Network/Internal/NetworkHandlers.cs b/Dalamud/Game/Network/Internal/NetworkHandlers.cs index 987de39fa..5ca7da54a 100644 --- a/Dalamud/Game/Network/Internal/NetworkHandlers.cs +++ b/Dalamud/Game/Network/Internal/NetworkHandlers.cs @@ -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 Sales) sales, - ICollection listings, + List listings, ulong uploaderId, uint worldId) { diff --git a/Dalamud/Game/Text/SeStringHandling/Payload.cs b/Dalamud/Game/Text/SeStringHandling/Payload.cs index c797c4a91..5f510269b 100644 --- a/Dalamud/Game/Text/SeStringHandling/Payload.cs +++ b/Dalamud/Game/Text/SeStringHandling/Payload.cs @@ -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; } } diff --git a/Dalamud/Interface/FontIdentifier/SystemFontFamilyId.cs b/Dalamud/Interface/FontIdentifier/SystemFontFamilyId.cs index 710301837..67c081192 100644 --- a/Dalamud/Interface/FontIdentifier/SystemFontFamilyId.cs +++ b/Dalamud/Interface/FontIdentifier/SystemFontFamilyId.cs @@ -117,7 +117,7 @@ public sealed class SystemFontFamilyId : IFontFamilyId return new(IObjectWithLocalizableName.GetLocaleNames(fn)); } - private unsafe IReadOnlyList GetFonts() + private unsafe List GetFonts() { using var dwf = default(ComPtr); fixed (Guid* piid = &IID.IID_IDWriteFactory) diff --git a/Dalamud/Interface/ImGuiFontChooserDialog/SingleFontChooserDialog.cs b/Dalamud/Interface/ImGuiFontChooserDialog/SingleFontChooserDialog.cs index 23cc2e1e6..5c23825c5 100644 --- a/Dalamud/Interface/ImGuiFontChooserDialog/SingleFontChooserDialog.cs +++ b/Dalamud/Interface/ImGuiFontChooserDialog/SingleFontChooserDialog.cs @@ -1235,7 +1235,7 @@ public sealed class SingleFontChooserDialog : IDisposable } private void UpdateSelectedFamilyAndFontIndices( - IReadOnlyList fonts, + List fonts, string familyName, string fontName) { diff --git a/Dalamud/Interface/Utility/Raii/EndObjects.cs b/Dalamud/Interface/Utility/Raii/EndObjects.cs index 80122360c..80ae495e2 100644 --- a/Dalamud/Interface/Utility/Raii/EndObjects.cs +++ b/Dalamud/Interface/Utility/Raii/EndObjects.cs @@ -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();