Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Waratah/HidEngine/TomlReportDescriptorParser/TagDecorator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public static class TagDecorator

private static readonly List<TagAttribute> CachedTagAttributes = new List<TagAttribute>();

private static readonly string[] NewlineSeparators = { "\r\n", "\r", "\n" };

static TagDecorator()
{
foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
Expand Down Expand Up @@ -218,7 +220,7 @@ private static string DecorateKeyNames(string tomlDoc)
// Monotonically increasing counter that is appended to the end
// of every key-name.
int suffixCounter = 1;
foreach (string line in tomlDoc.Split(new string[] { System.Environment.NewLine }, StringSplitOptions.None))
foreach (string line in tomlDoc.Split(NewlineSeparators, StringSplitOptions.None))
{
// This line contains a key-value pair.
if (line.Contains(KeyNameSeparator))
Expand Down Expand Up @@ -257,7 +259,7 @@ private static string DecorateKeyNames(string tomlDoc)
private static List<string> GenerateCleanSectionNames(string tomlDoc)
{
List<string> rawSectionNames = new List<string>();
foreach (string line in tomlDoc.Split(new string[] { System.Environment.NewLine }, StringSplitOptions.None))
foreach (string line in tomlDoc.Split(NewlineSeparators, StringSplitOptions.None))
{
// Ignore commented-out lines (starts with #)
if (line.Contains(SectionPrefix) && line.Contains(SectionSuffix) && !line.TrimStart().StartsWith("#"))
Expand Down
Loading