Small syntax changes

This commit is contained in:
Thorsten Sommer 2026-08-11 08:46:33 +02:00
parent e22ee39c9a
commit 21b902273f
Signed by untrusted user who does not match committer: tsommer
GPG Key ID: 371BBA77A02C0108
2 changed files with 18 additions and 18 deletions

View File

@ -300,7 +300,7 @@ public partial class AssistantBatchProcessing : AssistantBaseCore<NoSettingsPane
} }
} }
return files.ToList(); return [.. files];
} }
private static string TrimDirectorySeparator(string path) => path.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); private static string TrimDirectorySeparator(string path) => path.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);

View File

@ -10,7 +10,7 @@ namespace AIStudio.Assistants.BatchProcessing;
/// </summary> /// </summary>
public static class BatchProcessingCsv public static class BatchProcessingCsv
{ {
public const char SEPARATOR = '|'; private const char SEPARATOR = '|';
public static string ToCsvRow(params string[] fields) => string.Join(SEPARATOR, fields.Select(ToCsvField)); public static string ToCsvRow(params string[] fields) => string.Join(SEPARATOR, fields.Select(ToCsvField));
@ -43,22 +43,6 @@ public static class BatchProcessingCsv
var isQuoted = false; var isQuoted = false;
var hasContent = false; var hasContent = false;
void EndField()
{
fields.Add(field.ToString());
field.Clear();
}
void EndRow()
{
EndField();
if (hasContent)
rows.Add([..fields]);
fields.Clear();
hasContent = false;
}
for (var index = 0; index < content.Length; index++) for (var index = 0; index < content.Length; index++)
{ {
var character = content[index]; var character = content[index];
@ -112,5 +96,21 @@ public static class BatchProcessingCsv
EndRow(); EndRow();
return rows; return rows;
void EndField()
{
fields.Add(field.ToString());
field.Clear();
}
void EndRow()
{
EndField();
if (hasContent)
rows.Add([..fields]);
fields.Clear();
hasContent = false;
}
} }
} }