Browse Source

Merge pull request #222 from maartenba/mb-perf-5

Micro-optimization by compiling regular expression into QuestPDF assembly
Marcin Ziąbek 3 years ago
parent
commit
cd3f7f5a25
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)
         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)
         internal static void VisitChildren(this Element? element, Action<Element?> handler)