From 02707502e0bcf86a04f025e9803f1b27e7d6c4f7 Mon Sep 17 00:00:00 2001 From: NCLnclNCL <126905141+NCLnclNCL@users.noreply.github.com> Date: Wed, 12 Jun 2024 14:11:39 +0700 Subject: [PATCH] Update Utils.cs use stackalloc instead of new for optimize performance --- CompileTimeObfuscator/Utils.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CompileTimeObfuscator/Utils.cs b/CompileTimeObfuscator/Utils.cs index f4971b7..04ae632 100644 --- a/CompileTimeObfuscator/Utils.cs +++ b/CompileTimeObfuscator/Utils.cs @@ -22,7 +22,7 @@ public static string SanitizeForFileName(string str) /// Get a byte array literal string such as "new byte[]{1,2,3}" public static string ToByteArrayLiteralPresentation(ReadOnlySpan bytes) { - string prefix = "new byte[]{"; + string prefix = "stackalloc byte[]{"; string suffix = "}"; var builder = new StringBuilder(capacity: bytes.Length * 4 + prefix.Length + suffix.Length); builder.Append(prefix);