refactor: Tidying, resolving warnings

This commit is contained in:
Chris Cameron
2021-05-20 17:09:12 -04:00
parent f328598f63
commit 8b848e5127
5 changed files with 9 additions and 16 deletions

View File

@@ -43,7 +43,7 @@ namespace ICD.Common.Utils.Csv
#region Methods to read Csv data
/// <summary>
/// Parse a Csv stream into IEnumerable<string[]>, while permitting embedded newlines
/// Parse a Csv stream into IEnumerable&lt;string[]&gt;, while permitting embedded newlines
/// </summary>
/// <param name="inStream">The stream to read</param>
/// <param name="settings">The Csv settings to use for this parsing operation (Default: Csv)</param>
@@ -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)

View File

@@ -21,7 +21,7 @@ namespace ICD.Common.Utils.Csv
/// <summary>
/// If the first row in the file is a header row, this will be populated
/// </summary>
public string[] Headers = null;
public string[] Headers;
#endregion

View File

@@ -88,7 +88,7 @@ namespace ICD.Common.Utils.Csv
/// <summary>
/// Standard comma-separated value (Csv) file settings that permit rendering of NULL values
/// </summary>
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
/// <summary>
/// Standard tab-separated value (TSV) file settings
/// </summary>
public static readonly CsvReaderSettings TSV = new CsvReaderSettings() {
public static readonly CsvReaderSettings TSV = new CsvReaderSettings
{
FieldDelimiter = '\t'
};
}

View File

@@ -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);

View File

@@ -12,16 +12,13 @@ namespace ICD.Common.Utils
/// <typeparam name="T"></typeparam>
public sealed class ThreadedWorkerQueue<T>
{
private readonly PriorityQueue<T> m_Queue;
private readonly SafeCriticalSection m_QueueSection;
private readonly SafeCriticalSection m_ProcessSection;
private readonly Action<T> m_ProcessAction;
/// <summary>
///
/// Constructor.
/// </summary>
/// <param name="processItemAction">Action to process the dequeued items</param>
public ThreadedWorkerQueue([NotNull] Action<T> processItemAction)
@@ -36,7 +33,6 @@ namespace ICD.Common.Utils
m_ProcessAction = processItemAction;
}
#region Queue Methods
/// <summary>
@@ -140,7 +136,7 @@ namespace ICD.Common.Utils
private void Enqueue(Action enqueueAction)
{
m_QueueSection.Execute(() => enqueueAction());
m_QueueSection.Execute(enqueueAction);
ThreadingUtils.SafeInvoke(ProcessQueue);
}