mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-08-11 19:52:10 +00:00
Small syntax changes
This commit is contained in:
parent
e22ee39c9a
commit
21b902273f
@ -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);
|
||||||
|
|||||||
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user