use HashSet rather than Distinct() for filtering duplicate rules in a list

This commit is contained in:
Collin M. Barrett 2018-02-07 12:39:00 -06:00
parent cadaae4475
commit 43d100c309

View file

@ -80,7 +80,7 @@ private static List<string> GetRawRules(string content)
var rawRules = content.Split(new[] {"\r\n", "\r", "\n"}, StringSplitOptions.RemoveEmptyEntries).ToList();
for (var i = 0; i < rawRules.Count; i++)
rawRules[i] = rawRules[i].LintStringForMySql();
return rawRules.Where(x => !string.IsNullOrWhiteSpace(x)).Distinct().ToList();
return new List<string>(new HashSet<string>(rawRules.Where(x => !string.IsNullOrWhiteSpace(x))));
}
private IEnumerable<SnapshotBatchDe> GetSnapshotBatches(List<string> rawRules)