Skip to content

Commit

Permalink
CSHARP-5349: Code review changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
rstam committed Nov 15, 2024
1 parent c2c3cfd commit bed9e9b
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/MongoDB.Bson/Serialization/BsonSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ internal static IDiscriminatorConvention GetOrRegisterDiscriminatorConvention(Ty
__configLock.EnterReadLock();
try
{
if (__discriminatorConventions.TryGetValue(type, out var registeredConvention))
if (__discriminatorConventions.TryGetValue(type, out var registeredDiscriminatorConvention))
{
return registeredConvention;
return registeredDiscriminatorConvention;
}
}
finally
Expand All @@ -287,15 +287,13 @@ internal static IDiscriminatorConvention GetOrRegisterDiscriminatorConvention(Ty
__configLock.EnterWriteLock();
try
{
if (__discriminatorConventions.TryGetValue(type, out var registeredConvention))
if (__discriminatorConventions.TryGetValue(type, out var registeredDiscrimantorConvention))
{
return registeredConvention;
}
else
{
RegisterDiscriminatorConvention(type, discriminatorConvention);
return discriminatorConvention;
return registeredDiscrimantorConvention;
}

RegisterDiscriminatorConvention(type, discriminatorConvention);
return discriminatorConvention;
}
finally
{
Expand Down

0 comments on commit bed9e9b

Please sign in to comment.