性能优化,减少Lambda闭包分配

This commit is contained in:
2024-12-12 10:55:17 +08:00
parent b34ac104ef
commit fb3c4ac5f6
3 changed files with 10 additions and 4 deletions

View File

@@ -133,7 +133,7 @@ public class CsvReader : IDataReader
if (!hasQuote && currChar == delimiter)
{
result.Add(source[start..(end)].ToString());
result.Add(source[start..(end)].ToString()); // 超大型字符串会在LOH中分配内存没救
start = end + 1;
++end;
}