From 64c49a5c9b1c90880ea9158e8c5205e747c35117 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Wed, 11 Oct 2023 14:07:39 +1100 Subject: [PATCH] use sone utf8 string literals --- .../Protocols/Apollo/Utf8MessageBodies.cs | 17 +- .../Protocols/Apollo/Utf8MessageProperties.cs | 4 +- .../Protocols/Apollo/Utf8Messages.cs | 127 +--------- .../GraphQLOverWebSocket/Utf8MessageBodies.cs | 38 +-- .../Utf8MessageProperties.cs | 4 +- .../GraphQLOverWebSocket/Utf8Messages.cs | 95 +------- .../GraphQLOverWebSocket/Utf8Messages.cs | 95 +------- .../MultiPartResultFormatter.Constants.cs | 26 +- .../src/Language.Utf8/GraphQLKeywords.cs | 230 +++--------------- .../Utf8GraphQLRequestParser.Constants.cs | 78 +----- 10 files changed, 78 insertions(+), 636 deletions(-) diff --git a/src/HotChocolate/AspNetCore/src/AspNetCore/Subscriptions/Protocols/Apollo/Utf8MessageBodies.cs b/src/HotChocolate/AspNetCore/src/AspNetCore/Subscriptions/Protocols/Apollo/Utf8MessageBodies.cs index f57118ae1f3..1ddc1599285 100644 --- a/src/HotChocolate/AspNetCore/src/AspNetCore/Subscriptions/Protocols/Apollo/Utf8MessageBodies.cs +++ b/src/HotChocolate/AspNetCore/src/AspNetCore/Subscriptions/Protocols/Apollo/Utf8MessageBodies.cs @@ -2,22 +2,7 @@ namespace HotChocolate.AspNetCore.Subscriptions.Protocols.Apollo; internal static class Utf8MessageBodies { - private static readonly byte[] _keepAlive = - { - (byte)'{', - (byte)'"', - (byte)'t', - (byte)'y', - (byte)'p', - (byte)'e', - (byte)'"', - (byte)':', - (byte)'"', - (byte)'k', - (byte)'a', - (byte)'"', - (byte)'}' - }; + private static readonly byte[] _keepAlive = "{\"type\":\"ka\"}"u8.ToArray(); public static ReadOnlyMemory KeepAlive => _keepAlive; } diff --git a/src/HotChocolate/AspNetCore/src/AspNetCore/Subscriptions/Protocols/Apollo/Utf8MessageProperties.cs b/src/HotChocolate/AspNetCore/src/AspNetCore/Subscriptions/Protocols/Apollo/Utf8MessageProperties.cs index 4e8480f7bf9..b4c09be46ea 100644 --- a/src/HotChocolate/AspNetCore/src/AspNetCore/Subscriptions/Protocols/Apollo/Utf8MessageProperties.cs +++ b/src/HotChocolate/AspNetCore/src/AspNetCore/Subscriptions/Protocols/Apollo/Utf8MessageProperties.cs @@ -6,8 +6,8 @@ internal static class Utf8MessageProperties // This uses C# compiler's ability to refer to static data directly. // For more information see https://vcsjones.dev/2019/02/01/csharp-readonly-span-bytes-static public static ReadOnlySpan Id - => new[] { (byte)'i', (byte)'d' }; + => "id"u8; public static ReadOnlySpan Type - => new[] { (byte)'t', (byte)'y', (byte)'p', (byte)'e' }; + => "type"u8; } diff --git a/src/HotChocolate/AspNetCore/src/AspNetCore/Subscriptions/Protocols/Apollo/Utf8Messages.cs b/src/HotChocolate/AspNetCore/src/AspNetCore/Subscriptions/Protocols/Apollo/Utf8Messages.cs index 765b456ed8b..540b0368a29 100644 --- a/src/HotChocolate/AspNetCore/src/AspNetCore/Subscriptions/Protocols/Apollo/Utf8Messages.cs +++ b/src/HotChocolate/AspNetCore/src/AspNetCore/Subscriptions/Protocols/Apollo/Utf8Messages.cs @@ -4,138 +4,29 @@ internal static class Utf8Messages { // This uses C# compiler's ability to refer to static data directly. For more information see https://vcsjones.dev/2019/02/01/csharp-readonly-span-bytes-static public static ReadOnlySpan ConnectionInitialize => - new[] - { - (byte)'c', - (byte)'o', - (byte)'n', - (byte)'n', - (byte)'e', - (byte)'c', - (byte)'t', - (byte)'i', - (byte)'o', - (byte)'n', - (byte)'_', - (byte)'i', - (byte)'n', - (byte)'i', - (byte)'t' - }; + "connection_init"u8; public static ReadOnlySpan ConnectionAccept => - new[] - { - (byte)'c', - (byte)'o', - (byte)'n', - (byte)'n', - (byte)'e', - (byte)'c', - (byte)'t', - (byte)'i', - (byte)'o', - (byte)'n', - (byte)'_', - (byte)'a', - (byte)'c', - (byte)'k' - }; + "connection_ack"u8; public static ReadOnlySpan ConnectionError => - new[] - { - (byte)'c', - (byte)'o', - (byte)'n', - (byte)'n', - (byte)'e', - (byte)'c', - (byte)'t', - (byte)'i', - (byte)'o', - (byte)'n', - (byte)'_', - (byte)'e', - (byte)'r', - (byte)'r', - (byte)'o', - (byte)'r' - }; + "connection_error"u8; public static ReadOnlySpan ConnectionTerminate => - new[] - { - (byte)'c', - (byte)'o', - (byte)'n', - (byte)'n', - (byte)'e', - (byte)'c', - (byte)'t', - (byte)'i', - (byte)'o', - (byte)'n', - (byte)'_', - (byte)'t', - (byte)'e', - (byte)'r', - (byte)'m', - (byte)'i', - (byte)'n', - (byte)'a', - (byte)'t', - (byte)'e' - }; + "connection_terminate"u8; public static ReadOnlySpan Start => - new[] - { - (byte)'s', - (byte)'t', - (byte)'a', - (byte)'r', - (byte)'t' - }; + "start"u8; public static ReadOnlySpan Stop => - new[] - { - (byte)'s', - (byte)'t', - (byte)'o', - (byte)'p', - }; + "stop"u8; public static ReadOnlySpan Data => - new[] - { - (byte)'d', - (byte)'a', - (byte)'t', - (byte)'a', - }; + "data"u8; public static ReadOnlySpan Error => - new[] - { - (byte)'e', - (byte)'r', - (byte)'r', - (byte)'o', - (byte)'r' - }; + "error"u8; public static ReadOnlySpan Complete => - new[] - { - (byte)'c', - (byte)'o', - (byte)'m', - (byte)'p', - (byte)'l', - (byte)'e', - (byte)'t', - (byte)'e' - }; + "complete"u8; } diff --git a/src/HotChocolate/AspNetCore/src/AspNetCore/Subscriptions/Protocols/GraphQLOverWebSocket/Utf8MessageBodies.cs b/src/HotChocolate/AspNetCore/src/AspNetCore/Subscriptions/Protocols/GraphQLOverWebSocket/Utf8MessageBodies.cs index e720402003b..c8914276b98 100644 --- a/src/HotChocolate/AspNetCore/src/AspNetCore/Subscriptions/Protocols/GraphQLOverWebSocket/Utf8MessageBodies.cs +++ b/src/HotChocolate/AspNetCore/src/AspNetCore/Subscriptions/Protocols/GraphQLOverWebSocket/Utf8MessageBodies.cs @@ -2,43 +2,9 @@ namespace HotChocolate.AspNetCore.Subscriptions.Protocols.GraphQLOverWebSocket; internal static class Utf8MessageBodies { - private static readonly byte[] _defaultPong = - { - (byte)'{', - (byte)'"', - (byte)'t', - (byte)'y', - (byte)'p', - (byte)'e', - (byte)'"', - (byte)':', - (byte)'"', - (byte)'p', - (byte)'o', - (byte)'n', - (byte)'g', - (byte)'"', - (byte)'}', - }; + private static readonly byte[] _defaultPong = "{\"type\":\"pong\"}"u8.ToArray(); - private static readonly byte[] _defaultPing = - { - (byte)'{', - (byte)'"', - (byte)'t', - (byte)'y', - (byte)'p', - (byte)'e', - (byte)'"', - (byte)':', - (byte)'"', - (byte)'p', - (byte)'i', - (byte)'n', - (byte)'g', - (byte)'"', - (byte)'}', - }; + private static readonly byte[] _defaultPing = "{\"type\":\"ping\"}"u8.ToArray(); public static ReadOnlyMemory DefaultPing => _defaultPing; diff --git a/src/HotChocolate/AspNetCore/src/AspNetCore/Subscriptions/Protocols/GraphQLOverWebSocket/Utf8MessageProperties.cs b/src/HotChocolate/AspNetCore/src/AspNetCore/Subscriptions/Protocols/GraphQLOverWebSocket/Utf8MessageProperties.cs index e4991ec5721..a1abe4fddb8 100644 --- a/src/HotChocolate/AspNetCore/src/AspNetCore/Subscriptions/Protocols/GraphQLOverWebSocket/Utf8MessageProperties.cs +++ b/src/HotChocolate/AspNetCore/src/AspNetCore/Subscriptions/Protocols/GraphQLOverWebSocket/Utf8MessageProperties.cs @@ -6,8 +6,8 @@ internal static class Utf8MessageProperties // This uses C# compiler's ability to refer to static data directly. // For more information see https://vcsjones.dev/2019/02/01/csharp-readonly-span-bytes-static public static ReadOnlySpan Type - => new[] { (byte)'t', (byte)'y', (byte)'p', (byte)'e' }; + => "type"u8; public static ReadOnlySpan Payload - => new[] { (byte)'p', (byte)'a', (byte)'y', (byte)'l', (byte)'o', (byte)'a', (byte)'d' }; + => "payload"u8; } diff --git a/src/HotChocolate/AspNetCore/src/AspNetCore/Subscriptions/Protocols/GraphQLOverWebSocket/Utf8Messages.cs b/src/HotChocolate/AspNetCore/src/AspNetCore/Subscriptions/Protocols/GraphQLOverWebSocket/Utf8Messages.cs index 9bbf4ca8dfb..4fa3f9675d5 100644 --- a/src/HotChocolate/AspNetCore/src/AspNetCore/Subscriptions/Protocols/GraphQLOverWebSocket/Utf8Messages.cs +++ b/src/HotChocolate/AspNetCore/src/AspNetCore/Subscriptions/Protocols/GraphQLOverWebSocket/Utf8Messages.cs @@ -4,105 +4,26 @@ internal static class Utf8Messages { // This uses C# compiler's ability to refer to static data directly. For more information see https://vcsjones.dev/2019/02/01/csharp-readonly-span-bytes-static public static ReadOnlySpan ConnectionInitialize => - new[] - { - (byte)'c', - (byte)'o', - (byte)'n', - (byte)'n', - (byte)'e', - (byte)'c', - (byte)'t', - (byte)'i', - (byte)'o', - (byte)'n', - (byte)'_', - (byte)'i', - (byte)'n', - (byte)'i', - (byte)'t' - }; + "connection_init"u8; public static ReadOnlySpan ConnectionAccept => - new[] - { - (byte)'c', - (byte)'o', - (byte)'n', - (byte)'n', - (byte)'e', - (byte)'c', - (byte)'t', - (byte)'i', - (byte)'o', - (byte)'n', - (byte)'_', - (byte)'a', - (byte)'c', - (byte)'k' - }; + "connection_ack"u8; public static ReadOnlySpan Subscribe => - new[] - { - (byte)'s', - (byte)'u', - (byte)'b', - (byte)'s', - (byte)'c', - (byte)'r', - (byte)'i', - (byte)'b', - (byte)'e' - }; + "subscribe"u8; public static ReadOnlySpan Next => - new[] - { - (byte)'n', - (byte)'e', - (byte)'x', - (byte)'t' - }; + "next"u8; public static ReadOnlySpan Error => - new[] - { - (byte)'e', - (byte)'r', - (byte)'r', - (byte)'o', - (byte)'r' - }; + "error"u8; public static ReadOnlySpan Complete => - new[] - { - (byte)'c', - (byte)'o', - (byte)'m', - (byte)'p', - (byte)'l', - (byte)'e', - (byte)'t', - (byte)'e' - }; + "complete"u8; public static ReadOnlySpan Ping => - new[] - { - (byte)'p', - (byte)'i', - (byte)'n', - (byte)'g' - }; + "ping"u8; public static ReadOnlySpan Pong => - new[] - { - (byte)'p', - (byte)'o', - (byte)'n', - (byte)'g' - }; + "pong"u8; } diff --git a/src/HotChocolate/AspNetCore/src/Transport.Sockets.Client/Protocols/GraphQLOverWebSocket/Utf8Messages.cs b/src/HotChocolate/AspNetCore/src/Transport.Sockets.Client/Protocols/GraphQLOverWebSocket/Utf8Messages.cs index 3d79ffe23f0..8636bf120a6 100644 --- a/src/HotChocolate/AspNetCore/src/Transport.Sockets.Client/Protocols/GraphQLOverWebSocket/Utf8Messages.cs +++ b/src/HotChocolate/AspNetCore/src/Transport.Sockets.Client/Protocols/GraphQLOverWebSocket/Utf8Messages.cs @@ -6,105 +6,26 @@ internal static class Utf8Messages { // This uses C# compiler's ability to refer to static data directly. For more information see https://vcsjones.dev/2019/02/01/csharp-readonly-span-bytes-static public static ReadOnlySpan ConnectionInitialize => - new[] - { - (byte)'c', - (byte)'o', - (byte)'n', - (byte)'n', - (byte)'e', - (byte)'c', - (byte)'t', - (byte)'i', - (byte)'o', - (byte)'n', - (byte)'_', - (byte)'i', - (byte)'n', - (byte)'i', - (byte)'t' - }; + "connection_init"u8; public static ReadOnlySpan ConnectionAccept => - new[] - { - (byte)'c', - (byte)'o', - (byte)'n', - (byte)'n', - (byte)'e', - (byte)'c', - (byte)'t', - (byte)'i', - (byte)'o', - (byte)'n', - (byte)'_', - (byte)'a', - (byte)'c', - (byte)'k' - }; + "connection_ack"u8; public static ReadOnlySpan Subscribe => - new[] - { - (byte)'s', - (byte)'u', - (byte)'b', - (byte)'s', - (byte)'c', - (byte)'r', - (byte)'i', - (byte)'b', - (byte)'e' - }; + "subscribe"u8; public static ReadOnlySpan Next => - new[] - { - (byte)'n', - (byte)'e', - (byte)'x', - (byte)'t' - }; + "next"u8; public static ReadOnlySpan Error => - new[] - { - (byte)'e', - (byte)'r', - (byte)'r', - (byte)'o', - (byte)'r' - }; + "error"u8; public static ReadOnlySpan Complete => - new[] - { - (byte)'c', - (byte)'o', - (byte)'m', - (byte)'p', - (byte)'l', - (byte)'e', - (byte)'t', - (byte)'e' - }; + "complete"u8; public static ReadOnlySpan Ping => - new[] - { - (byte)'p', - (byte)'i', - (byte)'n', - (byte)'g' - }; + "ping"u8; public static ReadOnlySpan Pong => - new[] - { - (byte)'p', - (byte)'o', - (byte)'n', - (byte)'g' - }; + "pong"u8; } diff --git a/src/HotChocolate/Core/src/Execution/Serialization/MultiPartResultFormatter.Constants.cs b/src/HotChocolate/Core/src/Execution/Serialization/MultiPartResultFormatter.Constants.cs index af93c6a92df..44766fbf6d4 100644 --- a/src/HotChocolate/Core/src/Execution/Serialization/MultiPartResultFormatter.Constants.cs +++ b/src/HotChocolate/Core/src/Execution/Serialization/MultiPartResultFormatter.Constants.cs @@ -2,29 +2,11 @@ namespace HotChocolate.Execution.Serialization; public sealed partial class MultiPartResultFormatter { - private static byte[] ContentType { get; } = - { - (byte)'C', (byte)'o', (byte)'n', (byte)'t', (byte)'e', (byte)'n', (byte)'t', - (byte)'-', (byte)'T', (byte)'y', (byte)'p', (byte)'e', (byte)':', (byte)' ', - (byte)'a', (byte)'p', (byte)'p', (byte)'l', (byte)'i', (byte)'c', (byte)'a', - (byte)'t', (byte)'i', (byte)'o', (byte)'n', (byte)'/', (byte)'j', (byte)'s', - (byte)'o', (byte)'n', (byte)';', (byte)' ', (byte)'c', (byte)'h', (byte)'a', - (byte)'r', (byte)'s', (byte)'e', (byte)'t', (byte)'=', (byte)'u', (byte)'t', - (byte)'f', (byte)'-', (byte)'8' - }; + private static byte[] ContentType { get; } = "Content-Type: application/json; charset=utf-8"u8.ToArray(); - private static byte[] Start { get; } = - { - (byte)'-', (byte)'-', (byte)'-' - }; + private static byte[] Start { get; } = "---"u8.ToArray(); - private static byte[] End { get; } = - { - (byte)'-', (byte)'-', (byte)'-', (byte)'-', (byte)'-' - }; + private static byte[] End { get; } = "-----"u8.ToArray(); - private static byte[] CrLf { get; } = - { - (byte)'\r', (byte)'\n' - }; + private static byte[] CrLf { get; } = "\r\n"u8.ToArray(); } diff --git a/src/HotChocolate/Language/src/Language.Utf8/GraphQLKeywords.cs b/src/HotChocolate/Language/src/Language.Utf8/GraphQLKeywords.cs index 9b1420305b2..d4a239e15bb 100644 --- a/src/HotChocolate/Language/src/Language.Utf8/GraphQLKeywords.cs +++ b/src/HotChocolate/Language/src/Language.Utf8/GraphQLKeywords.cs @@ -5,203 +5,43 @@ namespace HotChocolate.Language; internal static class GraphQLKeywords { // type system - public static ReadOnlySpan Schema => new[] - { - (byte)'s', - (byte)'c', - (byte)'h', - (byte)'e', - (byte)'m', - (byte)'a' - }; - - public static ReadOnlySpan Scalar => new[] - { - (byte)'s', - (byte)'c', - (byte)'a', - (byte)'l', - (byte)'a', - (byte)'r' - }; - - public static ReadOnlySpan Type => new[] - { - (byte)'t', - (byte)'y', - (byte)'p', - (byte)'e' - }; - - public static ReadOnlySpan Interface => new[] - { - (byte)'i', - (byte)'n', - (byte)'t', - (byte)'e', - (byte)'r', - (byte)'f', - (byte)'a', - (byte)'c', - (byte)'e' - }; - - public static ReadOnlySpan Union => new[] - { - (byte)'u', - (byte)'n', - (byte)'i', - (byte)'o', - (byte)'n' - }; - - public static ReadOnlySpan Enum => new[] - { - (byte)'e', - (byte)'n', - (byte)'u', - (byte)'m' - }; - - public static ReadOnlySpan Input => new[] - { - (byte)'i', - (byte)'n', - (byte)'p', - (byte)'u', - (byte)'t' - }; - - public static ReadOnlySpan Extend => new[] - { - (byte)'e', - (byte)'x', - (byte)'t', - (byte)'e', - (byte)'n', - (byte)'d' - }; - - public static ReadOnlySpan Implements => new[] - { - (byte)'i', - (byte)'m', - (byte)'p', - (byte)'l', - (byte)'e', - (byte)'m', - (byte)'e', - (byte)'n', - (byte)'t', - (byte)'s' - }; - - public static ReadOnlySpan Repeatable => new[] - { - (byte)'r', - (byte)'e', - (byte)'p', - (byte)'e', - (byte)'a', - (byte)'t', - (byte)'a', - (byte)'b', - (byte)'l', - (byte)'e' - }; - - public static ReadOnlySpan Directive => new[] - { - (byte)'d', - (byte)'i', - (byte)'r', - (byte)'e', - (byte)'c', - (byte)'t', - (byte)'i', - (byte)'v', - (byte)'e' - }; + public static ReadOnlySpan Schema => "schema"u8; + + public static ReadOnlySpan Scalar => "scalar"u8; + + public static ReadOnlySpan Type => "type"u8; + + public static ReadOnlySpan Interface => "interface"u8; + + public static ReadOnlySpan Union => "union"u8; + + public static ReadOnlySpan Enum => "enum"u8; + + public static ReadOnlySpan Input => "input"u8; + + public static ReadOnlySpan Extend => "extend"u8; + + public static ReadOnlySpan Implements => "implements"u8; + + public static ReadOnlySpan Repeatable => "repeatable"u8; + + public static ReadOnlySpan Directive => "directive"u8; // query - public static ReadOnlySpan Query => new[] - { - (byte)'q', - (byte)'u', - (byte)'e', - (byte)'r', - (byte)'y' - }; - - public static ReadOnlySpan Mutation => new[] - { - (byte)'m', - (byte)'u', - (byte)'t', - (byte)'a', - (byte)'t', - (byte)'i', - (byte)'o', - (byte)'n' - }; - - public static ReadOnlySpan Subscription => new[] - { - (byte)'s', - (byte)'u', - (byte)'b', - (byte)'s', - (byte)'c', - (byte)'r', - (byte)'i', - (byte)'p', - (byte)'t', - (byte)'i', - (byte)'o', - (byte)'n' - }; - - public static ReadOnlySpan Fragment => new[] - { - (byte)'f', - (byte)'r', - (byte)'a', - (byte)'g', - (byte)'m', - (byte)'e', - (byte)'n', - (byte)'t' - }; + public static ReadOnlySpan Query => "query"u8; + + public static ReadOnlySpan Mutation => "mutation"u8; + + public static ReadOnlySpan Subscription => "subscription"u8; + + public static ReadOnlySpan Fragment => "fragment"u8; // general - public static ReadOnlySpan On => new[] - { - (byte)'o', - (byte)'n' - }; - - public static ReadOnlySpan True => new[] - { - (byte)'t', - (byte)'r', - (byte)'u', - (byte)'e' - }; - - public static ReadOnlySpan False => new[] - { - (byte)'f', - (byte)'a', - (byte)'l', - (byte)'s', - (byte)'e' - }; - - public static ReadOnlySpan Null => new[] - { - (byte)'n', - (byte)'u', - (byte)'l', - (byte)'l' - }; + public static ReadOnlySpan On => "on"u8; + + public static ReadOnlySpan True => "true"u8; + + public static ReadOnlySpan False => "false"u8; + + public static ReadOnlySpan Null => "null"u8; } diff --git a/src/HotChocolate/Language/src/Language.Web/Utf8GraphQLRequestParser.Constants.cs b/src/HotChocolate/Language/src/Language.Web/Utf8GraphQLRequestParser.Constants.cs index b64e36429b7..1d2b084798f 100644 --- a/src/HotChocolate/Language/src/Language.Web/Utf8GraphQLRequestParser.Constants.cs +++ b/src/HotChocolate/Language/src/Language.Web/Utf8GraphQLRequestParser.Constants.cs @@ -14,81 +14,17 @@ public ref partial struct Utf8GraphQLRequestParser private const byte _p = (byte)'p'; // This uses C# compiler's ability to refer to static data directly. For more information see https://vcsjones.dev/2019/02/01/csharp-readonly-span-bytes-static - private static ReadOnlySpan OperationName => new[] - { - (byte)'o', - (byte)'p', - (byte)'e', - (byte)'r', - (byte)'a', - (byte)'t', - (byte)'i', - (byte)'o', - (byte)'n', - (byte)'N', - (byte)'a', - (byte)'m', - (byte)'e' - }; + private static ReadOnlySpan OperationName => "operationName"u8; - private static ReadOnlySpan Query => new[] - { - (byte)'q', - (byte)'u', - (byte)'e', - (byte)'r', - (byte)'y' - }; + private static ReadOnlySpan Query => "query"u8; - private static ReadOnlySpan Variables => new[] - { - (byte)'v', - (byte)'a', - (byte)'r', - (byte)'i', - (byte)'a', - (byte)'b', - (byte)'l', - (byte)'e', - (byte)'s' - }; + private static ReadOnlySpan Variables => "variables"u8; - private static ReadOnlySpan Extensions => new[] - { - (byte)'e', - (byte)'x', - (byte)'t', - (byte)'e', - (byte)'n', - (byte)'s', - (byte)'i', - (byte)'o', - (byte)'n', - (byte)'s' - }; + private static ReadOnlySpan Extensions => "extensions"u8; - private static ReadOnlySpan Type => new[] - { - (byte)'t', - (byte)'y', - (byte)'p', - (byte)'e' - }; + private static ReadOnlySpan Type => "type"u8; - private static ReadOnlySpan Id => new[] - { - (byte)'i', - (byte)'d' - }; + private static ReadOnlySpan Id => "id"u8; - private static ReadOnlySpan Payload => new[] - { - (byte)'p', - (byte)'a', - (byte)'y', - (byte)'l', - (byte)'o', - (byte)'a', - (byte)'d' - }; + private static ReadOnlySpan Payload => "payload"u8; }