Remove unnecessary IsNull functions

This commit is contained in:
Haselnussbomber 2025-07-17 01:42:20 +02:00
parent 54ec64e159
commit 9956424c13
No known key found for this signature in database
GPG key ID: BB905BB49E7295D1
5 changed files with 17 additions and 31 deletions

View file

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using Dalamud.Bindings.ImGui;
@ -158,7 +158,7 @@ internal sealed class DelegateFontHandle : FontHandle
{
toolkitPreBuild.Font = default;
k.CallOnBuildStepChange(toolkitPreBuild);
if (toolkitPreBuild.Font.IsNull())
if (toolkitPreBuild.Font.IsNull)
{
if (fontCountPrevious == fontsVector.Length)
{

View file

@ -116,7 +116,7 @@ internal sealed partial class FontAtlasFactory
foreach (var s in this.data.Substances)
{
var f = s.GetFontPtr(fontHandle);
if (!f.IsNull())
if (!f.IsNull)
return f;
}
@ -215,7 +215,7 @@ internal sealed partial class FontAtlasFactory
}
catch
{
if (!font.IsNull())
if (!font.IsNull)
{
// Note that for both RemoveAt calls, corresponding destructors will be called.
@ -331,14 +331,14 @@ internal sealed partial class FontAtlasFactory
}
}
if (font.IsNull())
if (font.IsNull)
{
// fall back to AXIS fonts
font = this.AddGameGlyphs(new(GameFontFamily.Axis, sizePx), glyphRanges, default);
}
this.AttachExtraGlyphsForDalamudLanguage(new() { SizePx = sizePx, MergeFont = font });
if (this.Font.IsNull())
if (this.Font.IsNull)
this.Font = font;
return font;
}
@ -413,9 +413,9 @@ internal sealed partial class FontAtlasFactory
int style = (int)DWRITE_FONT_STYLE.DWRITE_FONT_STYLE_NORMAL)
{
var targetFont = fontConfig.MergeFont;
if (targetFont.IsNull())
if (targetFont.IsNull)
targetFont = this.Font;
if (targetFont.IsNull())
if (targetFont.IsNull)
return;
// https://learn.microsoft.com/en-us/windows/apps/design/globalizing/loc-international-fonts
@ -556,9 +556,9 @@ internal sealed partial class FontAtlasFactory
public void AttachExtraGlyphsForDalamudLanguage(in SafeFontConfig fontConfig)
{
var targetFont = fontConfig.MergeFont;
if (targetFont.IsNull())
if (targetFont.IsNull)
targetFont = this.Font;
if (targetFont.IsNull())
if (targetFont.IsNull)
return;
var dalamudConfiguration = Service<DalamudConfiguration>.Get();

View file

@ -182,7 +182,7 @@ internal abstract class FontHandle : IFontHandle
}
var fontPtr = substance.GetFontPtr(this);
if (fontPtr.IsNull())
if (fontPtr.IsNull)
{
// The font for the requested handle is unavailable. Release the reference and try again.
substance.DataRoot.Release();

View file

@ -1,4 +1,4 @@
using System.Buffers;
using System.Buffers;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
@ -250,7 +250,7 @@ internal class GamePrebakedFontHandle : FontHandle
GameFontStyle style,
ushort[]? glyphRanges = null)
{
if (font.IsNull())
if (font.IsNull)
font = this.CreateTemplateFont(toolkitPreBuild, style.SizePx);
this.attachments.Add((font, style, glyphRanges));
return font;