From 6d97fe151ab3fb6876bf118a0d02b2310e6d62e0 Mon Sep 17 00:00:00 2001 From: Adam Radocz Date: Mon, 18 Nov 2024 11:26:48 +0100 Subject: [PATCH] Optimize the RecyclableMemoryStream usage. --- .../OrchardCore.XmlRpc/Controllers/HomeController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OrchardCore.Modules/OrchardCore.XmlRpc/Controllers/HomeController.cs b/src/OrchardCore.Modules/OrchardCore.XmlRpc/Controllers/HomeController.cs index d69f4cf772c..587e802f0b3 100644 --- a/src/OrchardCore.Modules/OrchardCore.XmlRpc/Controllers/HomeController.cs +++ b/src/OrchardCore.Modules/OrchardCore.XmlRpc/Controllers/HomeController.cs @@ -54,7 +54,7 @@ public async Task ServiceEndpoint([ModelBinder(BinderType = typeo result.Save(w); } - var content = Encoding.UTF8.GetString(stream.GetBuffer(), 0, (int)stream.Length); + var content = Encoding.UTF8.GetString(stream.GetReadOnlySequence()); return Content(content, "text/xml"); }