From ff751e50ac1824d4ab24541862e51b00228eaedd Mon Sep 17 00:00:00 2001 From: Haselnussbomber Date: Fri, 24 Oct 2025 03:17:46 +0200 Subject: [PATCH] Fix IDE0007: Use 'var' instead of explicit type --- Dalamud/Game/NativeWrapper/AtkValuePtr.cs | 2 +- .../Game/Text/SeStringHandling/Payloads/PartyFinderPayload.cs | 4 ++-- Dalamud/Interface/ImGuiFileDialog/FileDialog.UI.cs | 2 +- Dalamud/Interface/Internal/Windows/ProfilerWindow.cs | 2 +- Dalamud/Plugin/Internal/PluginErrorHandler.cs | 2 +- Dalamud/Utility/Timing/Timings.cs | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Dalamud/Game/NativeWrapper/AtkValuePtr.cs b/Dalamud/Game/NativeWrapper/AtkValuePtr.cs index a47483a66..b274d388b 100644 --- a/Dalamud/Game/NativeWrapper/AtkValuePtr.cs +++ b/Dalamud/Game/NativeWrapper/AtkValuePtr.cs @@ -89,7 +89,7 @@ public readonly unsafe struct AtkValuePtr(nint address) : IEquatable public unsafe bool TryGet([NotNullWhen(true)] out T? result) where T : struct { - object? value = this.GetValue(); + var value = this.GetValue(); if (value is T typed) { result = typed; diff --git a/Dalamud/Game/Text/SeStringHandling/Payloads/PartyFinderPayload.cs b/Dalamud/Game/Text/SeStringHandling/Payloads/PartyFinderPayload.cs index 0931ab03f..21658bbdd 100644 --- a/Dalamud/Game/Text/SeStringHandling/Payloads/PartyFinderPayload.cs +++ b/Dalamud/Game/Text/SeStringHandling/Payloads/PartyFinderPayload.cs @@ -97,7 +97,7 @@ namespace Dalamud.Game.Text.SeStringHandling.Payloads reader.ReadByte(); // if the next byte is 0xF3 then this listing is limited to home world - byte nextByte = reader.ReadByte(); + var nextByte = reader.ReadByte(); switch (nextByte) { case (byte)PartyFinderLinkType.LimitedToHomeWorld: @@ -125,7 +125,7 @@ namespace Dalamud.Game.Text.SeStringHandling.Payloads // back to our regularly scheduled programming... var listingIDBytes = MakeInteger(this.ListingId); - bool isFlagSpecified = this.LinkType != PartyFinderLinkType.NotSpecified; + var isFlagSpecified = this.LinkType != PartyFinderLinkType.NotSpecified; var chunkLen = listingIDBytes.Length + 4; // 1 more byte for the type flag if it is specified diff --git a/Dalamud/Interface/ImGuiFileDialog/FileDialog.UI.cs b/Dalamud/Interface/ImGuiFileDialog/FileDialog.UI.cs index cf8ef8461..8adb01a8f 100644 --- a/Dalamud/Interface/ImGuiFileDialog/FileDialog.UI.cs +++ b/Dalamud/Interface/ImGuiFileDialog/FileDialog.UI.cs @@ -54,7 +54,7 @@ public partial class FileDialog windowVisible = ImGui.Begin(name, ref this.visible, this.WindowFlags); } - bool wasClosed = false; + var wasClosed = false; if (windowVisible) { if (!this.visible) diff --git a/Dalamud/Interface/Internal/Windows/ProfilerWindow.cs b/Dalamud/Interface/Internal/Windows/ProfilerWindow.cs index 7b05f643e..8ff407cd7 100644 --- a/Dalamud/Interface/Internal/Windows/ProfilerWindow.cs +++ b/Dalamud/Interface/Internal/Windows/ProfilerWindow.cs @@ -188,7 +188,7 @@ public class ProfilerWindow : Window } } - uint eventTextDepth = maxRectDept + 2; + var eventTextDepth = maxRectDept + 2; var eventsXPos = new List(); const float eventsXPosFudge = 5f; diff --git a/Dalamud/Plugin/Internal/PluginErrorHandler.cs b/Dalamud/Plugin/Internal/PluginErrorHandler.cs index 13f0bc637..6733cc3ca 100644 --- a/Dalamud/Plugin/Internal/PluginErrorHandler.cs +++ b/Dalamud/Plugin/Internal/PluginErrorHandler.cs @@ -150,7 +150,7 @@ internal class PluginErrorHandler : IServiceType // Create expressions to convert array elements to parameter types var callArgs = new Expression[parameters.Length]; - for (int i = 0; i < parameters.Length; i++) + for (var i = 0; i < parameters.Length; i++) { var paramType = parameters[i].ParameterType; var arrayAccess = Expression.ArrayIndex(argsParam, Expression.Constant(i)); diff --git a/Dalamud/Utility/Timing/Timings.cs b/Dalamud/Utility/Timing/Timings.cs index a59a3557f..563221fb9 100644 --- a/Dalamud/Utility/Timing/Timings.cs +++ b/Dalamud/Utility/Timing/Timings.cs @@ -53,7 +53,7 @@ public static class Timings var outerTimingHandle = TaskTimingHandles; return () => { - T res = default(T); + var res = default(T); var prev = TaskTimingHandles; TaskTimingHandles = outerTimingHandle; try