From 659a3bc2e727f49bb5fa82971f9f6e25db3bd2fb Mon Sep 17 00:00:00 2001 From: rube200 Date: Mon, 29 Jul 2024 00:57:39 +0100 Subject: [PATCH 1/3] Emitter using goto on switch case --- VYaml.SourceGenerator/Emitter.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/VYaml.SourceGenerator/Emitter.cs b/VYaml.SourceGenerator/Emitter.cs index 3deccaa..0c23b8d 100644 --- a/VYaml.SourceGenerator/Emitter.cs +++ b/VYaml.SourceGenerator/Emitter.cs @@ -420,12 +420,7 @@ static bool TryEmitDeserializeMethod( } branching = "else if"; } - using (codeWriter.BeginBlockScope("else")) - { - codeWriter.AppendLine("parser.Read(); // skip key"); - codeWriter.AppendLine("parser.SkipCurrentNode(); // skip value"); - } - codeWriter.AppendLine("continue;"); + codeWriter.AppendLine("goto default;"); } } From 537f91fb4ae3deb532a92042fbff71650e8e0171 Mon Sep 17 00:00:00 2001 From: rube200 Date: Mon, 29 Jul 2024 00:58:09 +0100 Subject: [PATCH 2/3] Update vulnerable nuget package --- VYaml.Benchmark/VYaml.Benchmark.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VYaml.Benchmark/VYaml.Benchmark.csproj b/VYaml.Benchmark/VYaml.Benchmark.csproj index 3c04f11..0fa8311 100644 --- a/VYaml.Benchmark/VYaml.Benchmark.csproj +++ b/VYaml.Benchmark/VYaml.Benchmark.csproj @@ -11,7 +11,7 @@ - + From 77d073ac8ba613a8addc9d275b2eff8dac15c624 Mon Sep 17 00:00:00 2001 From: rube200 Date: Mon, 29 Jul 2024 00:58:18 +0100 Subject: [PATCH 3/3] Fix key nullability warning --- VYaml/Serialization/Formatters/InterfaceDictionaryFormatter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VYaml/Serialization/Formatters/InterfaceDictionaryFormatter.cs b/VYaml/Serialization/Formatters/InterfaceDictionaryFormatter.cs index b8d27d0..41b26ec 100644 --- a/VYaml/Serialization/Formatters/InterfaceDictionaryFormatter.cs +++ b/VYaml/Serialization/Formatters/InterfaceDictionaryFormatter.cs @@ -5,7 +5,7 @@ namespace VYaml.Serialization { - public class InterfaceDictionaryFormatter : IYamlFormatter?> + public class InterfaceDictionaryFormatter : IYamlFormatter?> where TKey : notnull { public void Serialize(ref Utf8YamlEmitter emitter, IDictionary? value, YamlSerializationContext context) {