Skip to content

Commit

Permalink
Merge pull request #119 from rube200/master
Browse files Browse the repository at this point in the history
Use goto default on switch
  • Loading branch information
hadashiA authored Jul 29, 2024
2 parents aa786ee + 77d073a commit fa9b2ba
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion VYaml.Benchmark/VYaml.Benchmark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="System.Text.Json" Version="7.0.0" />
<PackageReference Include="System.Text.Json" Version="8.0.4" />
<PackageReference Include="YamlDotNet" Version="11.2.1" />
</ItemGroup>

Expand Down
7 changes: 1 addition & 6 deletions VYaml.SourceGenerator/Emitter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace VYaml.Serialization
{
public class InterfaceDictionaryFormatter<TKey, TValue> : IYamlFormatter<IDictionary<TKey, TValue>?>
public class InterfaceDictionaryFormatter<TKey, TValue> : IYamlFormatter<IDictionary<TKey, TValue>?> where TKey : notnull
{
public void Serialize(ref Utf8YamlEmitter emitter, IDictionary<TKey, TValue>? value, YamlSerializationContext context)
{
Expand Down

0 comments on commit fa9b2ba

Please sign in to comment.