File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,14 @@ namespace Belin.Lcov;
8
8
/// </summary>
9
9
/// <param name="testName">The test name.</param>
10
10
/// <param name="sourceFiles">The source file list.</param>
11
- public class Report ( string testName , IEnumerable < SourceFile > ? sourceFiles = null ) {
11
+ public partial class Report ( string testName , IEnumerable < SourceFile > ? sourceFiles = null ) {
12
+
13
+ /// <summary>
14
+ /// Gets the regular expression used to split the lines.
15
+ /// </summary>
16
+ /// <returns>The regular expression used to split the lines.</returns>
17
+ [ GeneratedRegex ( @"\r?\n" ) ]
18
+ private static partial Regex NewLinePattern ( ) ;
12
19
13
20
/// <summary>
14
21
/// The source file list.
@@ -31,7 +38,7 @@ public static Report Parse(string coverage) {
31
38
var report = new Report ( string . Empty ) ;
32
39
var sourceFile = new SourceFile ( path : string . Empty ) ;
33
40
34
- foreach ( var line in Regex . Split ( coverage , @"\r?\n" ) ) {
41
+ foreach ( var line in NewLinePattern ( ) . Split ( coverage ) ) {
35
42
offset ++ ;
36
43
if ( string . IsNullOrWhiteSpace ( line ) ) continue ;
37
44
You can’t perform that action at this time.
0 commit comments