diff --git a/Dalamud/Utility/RentedSeStringBuilder.cs b/Dalamud/Utility/RentedSeStringBuilder.cs new file mode 100644 index 000000000..93a45d967 --- /dev/null +++ b/Dalamud/Utility/RentedSeStringBuilder.cs @@ -0,0 +1,19 @@ +using Lumina.Text; + +namespace Dalamud.Utility; + +/// +/// Provides a temporarily rented from a shared pool. +/// +public readonly struct RentedSeStringBuilder() : IDisposable +{ + /// + /// Gets the rented value from the shared pool. + /// + public SeStringBuilder Builder { get; } = SeStringBuilder.SharedPool.Get(); + + /// + /// Returns the rented to the shared pool. + /// + public void Dispose() => SeStringBuilder.SharedPool.Return(this.Builder); +}