From 27dc6595610d461b2578271bf8ce532b40ff4fda Mon Sep 17 00:00:00 2001 From: Kaz Wolfe Date: Mon, 24 Mar 2025 18:32:44 -0700 Subject: [PATCH] chore: Convert AsLuminaSeString to AsReadOnlySeString - Somewhat more useful, or so one would hope. --- Dalamud/Utility/CStringExtensions.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Dalamud/Utility/CStringExtensions.cs b/Dalamud/Utility/CStringExtensions.cs index f025ee85c..acc70e469 100644 --- a/Dalamud/Utility/CStringExtensions.cs +++ b/Dalamud/Utility/CStringExtensions.cs @@ -35,16 +35,17 @@ public static class CStringExtensions } /// - /// Get a new SeString that's a copy of the text in this CStringPointer. + /// Get a new ReadOnlySeString that's a copy of the text in this CStringPointer. /// + /// + /// This should be functionally identical to , but exists + /// for convenience in places that already expect ReadOnlySeString as a type (and where a copy is desired). + /// /// The pointer to copy. - /// A new Lumina SeString. - public static Lumina.Text.SeString AsLuminaSeString(this CStringPointer ptr) + /// A new Lumina ReadOnlySeString. + public static ReadOnlySeString AsReadOnlySeString(this CStringPointer ptr) { - var ssb = new Lumina.Text.SeStringBuilder(); - ssb.Append(ptr.AsSpan()); - - return ssb.ToSeString(); + return new ReadOnlySeString(ptr.AsSpan().ToArray()); } ///