优化性能

This commit is contained in:
2024-02-08 17:38:23 +08:00
parent 20cc78c667
commit 8db7c71170
10 changed files with 67 additions and 58 deletions

View File

@@ -16,7 +16,6 @@ public class CsvReader : IDataReader
public DataRecord Current { get; protected set; } = null!;
public string[] Headers { get; }
public string? CurrentRaw { get; protected set; }
public string Delimiter { get; }
public char QuoteChar { get; }
@@ -50,10 +49,8 @@ public class CsvReader : IDataReader
if (string.IsNullOrWhiteSpace(str))
return false;
CurrentRaw = str;
var fields = ParseRow(str, QuoteChar, Delimiter);
Current = new DataRecord(fields, TableName, Headers){RawField = str};
Current = new DataRecord(fields, TableName, Headers);
return true;
}

View File

@@ -31,10 +31,8 @@ public class ZstReader : CsvReader
if (string.IsNullOrWhiteSpace(str))
return false;
CurrentRaw = str;
var fields = ParseRow(str, QuoteChar, Delimiter);
Current = new DataRecord(fields, TableName, Headers) {RawField = str};
Current = new DataRecord(fields, TableName, Headers);
return true;
}