diff --git a/ICD.Common.Utils/Csv/Csv.cs b/ICD.Common.Utils/Csv/Csv.cs index 083ae76..4a98a59 100644 --- a/ICD.Common.Utils/Csv/Csv.cs +++ b/ICD.Common.Utils/Csv/Csv.cs @@ -43,7 +43,7 @@ namespace ICD.Common.Utils.Csv #region Methods to read Csv data /// - /// Parse a Csv stream into IEnumerable, while permitting embedded newlines + /// Parse a Csv stream into IEnumerable<string[]>, while permitting embedded newlines /// /// The stream to read /// The Csv settings to use for this parsing operation (Default: Csv) @@ -127,7 +127,6 @@ namespace ICD.Common.Utils.Csv work.Append(settings.TextQualifier); i++; p2 = -1; - continue; } } @@ -224,10 +223,9 @@ namespace ICD.Common.Utils.Csv // If we are starting a new field, is this field text qualified? if ((c == settings.TextQualifier) && (work.Length == 0)) { - int p2; - while (true) + while (true) { - p2 = line.IndexOf(settings.TextQualifier, i + 1); + int p2 = line.IndexOf(settings.TextQualifier, i + 1); // If no closing qualifier is found, this string is broken; return failure. if (p2 < 0) diff --git a/ICD.Common.Utils/Csv/CsvReader.cs b/ICD.Common.Utils/Csv/CsvReader.cs index fdc294c..3038677 100644 --- a/ICD.Common.Utils/Csv/CsvReader.cs +++ b/ICD.Common.Utils/Csv/CsvReader.cs @@ -21,7 +21,7 @@ namespace ICD.Common.Utils.Csv /// /// If the first row in the file is a header row, this will be populated /// - public string[] Headers = null; + public string[] Headers; #endregion diff --git a/ICD.Common.Utils/Csv/CsvReaderSettings.cs b/ICD.Common.Utils/Csv/CsvReaderSettings.cs index 7cc0225..8beb1dd 100644 --- a/ICD.Common.Utils/Csv/CsvReaderSettings.cs +++ b/ICD.Common.Utils/Csv/CsvReaderSettings.cs @@ -88,7 +88,7 @@ namespace ICD.Common.Utils.Csv /// /// Standard comma-separated value (Csv) file settings that permit rendering of NULL values /// - public static readonly CsvReaderSettings CSV_PERMIT_NULL = new CsvReaderSettings() + public static readonly CsvReaderSettings CSV_PERMIT_NULL = new CsvReaderSettings { AllowNull = true, NullToken = "NULL" @@ -97,7 +97,8 @@ namespace ICD.Common.Utils.Csv /// /// Standard tab-separated value (TSV) file settings /// - public static readonly CsvReaderSettings TSV = new CsvReaderSettings() { + public static readonly CsvReaderSettings TSV = new CsvReaderSettings + { FieldDelimiter = '\t' }; } diff --git a/ICD.Common.Utils/TableBuilder.cs b/ICD.Common.Utils/TableBuilder.cs index 5d80f8a..7482a60 100644 --- a/ICD.Common.Utils/TableBuilder.cs +++ b/ICD.Common.Utils/TableBuilder.cs @@ -232,7 +232,6 @@ namespace ICD.Common.Utils { #if SIMPLSHARP // Can't do fancy tables so don't bother drawing the top row - return; #else builder.Append(DOWN_RIGHT).Append(HORIZONTAL); @@ -259,7 +258,6 @@ namespace ICD.Common.Utils { #if SIMPLSHARP AppendSeparator(builder, columnWidths); - return; #else builder.Append(UP_RIGHT).Append(HORIZONTAL); diff --git a/ICD.Common.Utils/ThreadedWorkerQueue.cs b/ICD.Common.Utils/ThreadedWorkerQueue.cs index 499f15c..34db9e9 100644 --- a/ICD.Common.Utils/ThreadedWorkerQueue.cs +++ b/ICD.Common.Utils/ThreadedWorkerQueue.cs @@ -12,16 +12,13 @@ namespace ICD.Common.Utils /// public sealed class ThreadedWorkerQueue { - private readonly PriorityQueue m_Queue; - private readonly SafeCriticalSection m_QueueSection; private readonly SafeCriticalSection m_ProcessSection; - private readonly Action m_ProcessAction; /// - /// + /// Constructor. /// /// Action to process the dequeued items public ThreadedWorkerQueue([NotNull] Action processItemAction) @@ -36,7 +33,6 @@ namespace ICD.Common.Utils m_ProcessAction = processItemAction; } - #region Queue Methods /// @@ -140,7 +136,7 @@ namespace ICD.Common.Utils private void Enqueue(Action enqueueAction) { - m_QueueSection.Execute(() => enqueueAction()); + m_QueueSection.Execute(enqueueAction); ThreadingUtils.SafeInvoke(ProcessQueue); }