From 0172994ac134a10e4d59093b45d391958a35e4b1 Mon Sep 17 00:00:00 2001 From: miko Date: Sat, 1 Jun 2024 16:05:04 +0800 Subject: [PATCH] Use collection expressions for source generation --- .../Contexts/TupleObjectConverterContext.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Binary.SourceGeneration/Contexts/TupleObjectConverterContext.cs b/code/Binary.SourceGeneration/Contexts/TupleObjectConverterContext.cs index 0575efa2..556c9312 100644 --- a/code/Binary.SourceGeneration/Contexts/TupleObjectConverterContext.cs +++ b/code/Binary.SourceGeneration/Contexts/TupleObjectConverterContext.cs @@ -22,7 +22,7 @@ private void AppendConverterHead() { var members = this.members; Output.AppendIndent(1, $"private sealed class {OutputConverterTypeName}(", ")", members.Length, i => $"{GetConverterTypeFullName(i)} cvt{i}"); - Output.AppendIndent(2, $": Mikodev.Binary.Converter<{SymbolTypeFullName}>(Mikodev.Binary.Components.TupleObject.GetConverterLength(new {Constants.IConverterTypeName}[] {{ ", $" }}))", members.Length, x => $"cvt{x}"); + Output.AppendIndent(2, $": Mikodev.Binary.Converter<{SymbolTypeFullName}>(Mikodev.Binary.Components.TupleObject.GetConverterLength([", $"]))", members.Length, x => $"cvt{x}"); Output.AppendIndent(1, $"{{"); CancellationToken.ThrowIfCancellationRequested(); }