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

View file

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

View file

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

View file

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

View file

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