You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creating HashSet is expensive when reading large file, since the validCommentChars do not change over the course of a single read API, initialize it once and use to to read entire file. Improves performance by about 15%
// A comment starts with a valid comment character that:
115
116
// 1. is not within a quote (eg. "this is # not a comment"), and
@@ -124,7 +125,6 @@ private static string ParseComment(string line, out int commentCharIndex)
124
125
intindex=0;
125
126
intquoteCount=0;
126
127
intlength=line.Length;
127
-
HashSet<char>validCommentChars=newHashSet<char>(Configuration.ValidCommentChars);// Use HashSet<char> for O(1) lookup instead of Array.IndexOf for O(n)
128
128
while(index<length)// traverse line from left to right
0 commit comments