Browse Source

Micro-optimization by compiling regular expression into QuestPDF assembly so there's no JIT compilation when using it

Maarten Balliauw 3 years ago
parent
commit
1047854f77
1 changed files with 1 additions and 1 deletions
  1. 1 1
      QuestPDF/Helpers/Helpers.cs

+ 1 - 1
QuestPDF/Helpers/Helpers.cs

@@ -41,7 +41,7 @@ namespace QuestPDF.Helpers
 
         internal static string PrettifyName(this string text)
         {
-            return Regex.Replace(text, @"([a-z])([A-Z])", "$1 $2");
+            return Regex.Replace(text, @"([a-z])([A-Z])", "$1 $2", RegexOptions.Compiled);
         }
 
         internal static void VisitChildren(this Element? element, Action<Element?> handler)